【问题标题】:Shopify API - get discount codes in the store with PHPShopify API - 使用 PHP 在商店中获取折扣码
【发布时间】:2015-07-07 02:29:41
【问题描述】:

通过 Shopify API 调用,我能够获取产品数据,但我需要一种方法来获取商店中可用的折扣代码。

我需要 PHP 中的脚本。有谁知道我如何实现这一目标?

【问题讨论】:

    标签: php shopify


    【解决方案1】:

    也许这些类似的问题会帮助您入门:

    上面的前 2 个链接提到了this project on GitHub。它提供了一个您可以使用的示例:

    require 'shopify.php';
    $api = new \Shopify\PrivateAPI('username', 'password', 'https://mystore.myshopify.com/admin');
    
    ...
    
    $discounts = $api->doRequest('GET', 'discounts.json', $params);
    if (isset($discounts->discounts)) {
        $coupons = $discounts->discounts;
        foreach ($coupons as $coupon) {
            print_r($coupon);
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-09
      • 1970-01-01
      • 2013-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多