alexschwarz89 / icecatxml
一个易于使用的库,用于访问 Icecat XML 目录
1.1.0
2017-03-18 20:14 UTC
Requires
- php: >=5.5
- guzzlehttp/guzzle: 6.2.*
This package is not auto-updated.
Last update: 2024-09-18 20:55:59 UTC
README
icecatxml
icecatxml是一个易于使用的包装器,用于访问Icecat API提供的产品数据。它应该与PHP 5.5+兼容。
安装
通过 composer 安装
{ "require": { "alexschwarz89/icecatxml" } }
运行 composer install
。
示例用法
通过 EAN/UPC 获取产品数据
use Alexschwarz89\IcecatXML\Api; $icecat = new Api('ACCOUNT_USERNAME', 'ACCOUNT_PASSWORD'); $xml = $icecat->getArticleByEAN('EAN');
通过厂商名称和 MPN 获取产品数据
use Alexschwarz89\IcecatXML\Api; $icecat = new Api('ACCOUNT_USERNAME', 'ACCOUNT_PASSWORD'); $xml = $icecat->getArticleByMPN('ExampleVendor', 'AA12345');
通过 Icecat ID 获取产品数据
use Alexschwarz89\IcecatXML\Api; $icecat = new Api('ACCOUNT_USERNAME', 'ACCOUNT_PASSWORD'); $xml = $icecat->getArticleById('27260205');
指定语言(可选)
默认语言是 "DE",要更改此设置,请设置可选参数 $lang,例如。
use Alexschwarz89\IcecatXML\Api; $icecat = new Api('ACCOUNT_USERNAME', 'ACCOUNT_PASSWORD'); $xml = $icecat->getArticleById('27260205', 'US');