affilinet/productdata-php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

affilinet/productdata-php-sdk

Composer 安装命令:

composer require affilinet/productdata-php-sdk

包简介

affilinet Product Data PHP SDK

README 文档

README

Grab our Product Data PHP SDK and have access to millions of products within minutes.

Refer to our documentation in order to get started: https://affilinet.github.io/productdata-php-sdk

SensioLabsInsight

Installation

This SDK can be installed with composer

composer require affilinet/productdata-php-sdk

Please note: This packages requires PHP 5.6 or greater.

Examples

$config = [
    'publisher_id' => {PUBLISHER ID},
    'product_webservice_password' => {PRODUCT WEBSERVICE PASSWORD}
]

$affilinet = new \Affilinet\ProductData\AffilinetClient($config);

// simple search for t-shirts (using the product webservice)
try {
    $search = new \Affilinet\ProductData\Requests\ProductsRequest($affilinet);
    $query = new \Affilinet\ProductData\Requests\Helper\Query();
    
    $query->where($query->expr()->exactly('T-Shirt'));
    
    $search
        ->query( $query)
        ->onlyWithImage()
        ->minPrice(1)
        ->maxPrice(100)
        ->page(1)
        ->pageSize(20);
    
    $response = $search->send();
}
catch (\Affilinet\ProductData\Exceptions\AffilinetProductWebserviceException $e) {
    // There is an error within your $search
    echo 'Error: ' . $e->getMessage();
}

echo 'Total results : ' . $response->totalRecords() ;

foreach ($response->getProducts() as $product) {
    echo $product->getProductName();
    echo $product->getPriceInformation()->getDisplayPrice();
}

Tests

All tests rely on composer. Please composer install before running the tests. phpunit tests include some integration tests. To run these tests you need to provide an publisherId and productWebservicePassword. Copy Tests/AffilinetTestCredentials.php.dist to Tests/AffilinetTestCredentials.php and enter your PUBLISHER_ID and PRODUCT_WEBSERVICE_PASSWORD

To run only the unit tests use this command:

phpunit --exclude-group integration

License

Please see the license file for more information.

统计信息

  • 总下载量: 3.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 6
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固