culturekings/shopify-php-api-wrapper
Composer 安装命令:
composer require culturekings/shopify-php-api-wrapper
包简介
Shopify PHP (Guzzle) API Wrapper
README 文档
README
Forked from Zapiet, moving towards batch requests & better handling of API call limits
Installing via Composer
The recommended way to install the wrapper is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version of the wrapper:
composer require shopifyextras/shopify-php-api-wrapper
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
Getting Started
First you will need to initialise the client like this:
$client = new \Shopify\Client([ "shopUrl" => $shopUrl, "X-Shopify-Access-Token" => $accessToken ]);
Then you can begin making requests like shown below. Please note that the list of requests below is not complete. All endpoints are available just take a look in the /src/resources folder for reference.
Orders
// Get a list of all orders. $client->getOrders(); // Get a specific order. $client->getOrder(['id' => $order_id]); // Get Order ID and Total Price for a specific order. $client->getOrder(['id' => $order_id, 'fields' => 'id,total_price']);
Products
// Get a list of all products. $client->getProducts(); // Get a specific product. $client->getProduct(["id" => $product_id]);
Product Variants
// Get a list of all variants for a specific product. $client->getProductVariants(["id" => $product_id]); // Get a specific product variant. $client->getProductVariant(["id" => $variant_id]); // Get metafields for a specific variant. $client->getProductVariantMetafields(["id" => $variant_id]);
To-do / Improvements
- Batching requests in a pool
- Handling of API call limits globally
- Improved Logging
Bugs & Issues
If you spot any bugs, please report it using the issue tracker. If you would like to contribute to the project please feel free to make your amends and submit a pull request.
culturekings/shopify-php-api-wrapper 适用场景与选型建议
culturekings/shopify-php-api-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.97k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 03 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 culturekings/shopify-php-api-wrapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 culturekings/shopify-php-api-wrapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-20