File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Created by PhpStorm.
4+ * @author Sergiu Cazac <kilobyte2007@gmail.com>
5+ * Created at 5/06/19 2:09 AM UTC+03:00
6+ *
7+ * @see https://help.shopify.com/api/reference/discounts/discountcode Shopify API Reference for PriceRule
8+ */
9+
10+ namespace PHPShopify ;
11+
12+
13+ class DiscountCode extends ShopifyResource
14+ {
15+ /**
16+ * @inheritDoc
17+ */
18+ protected $ resourceKey = 'discount_code ' ;
19+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Created by PhpStorm.
4+ * @author Sergiu Cazac <kilobyte2007@gmail.com>
5+ * Created at 5/06/19 2:06 AM UTC+03:00
6+ *
7+ * @see https://help.shopify.com/api/reference/discounts/pricerule Shopify API Reference for PriceRule
8+ */
9+
10+ namespace PHPShopify ;
11+
12+
13+ /*
14+ * --------------------------------------------------------------------------
15+ * PriceRule -> Child Resources
16+ * --------------------------------------------------------------------------
17+ * @property-read ShopifyResource $DiscountCode
18+ *
19+ * @method ShopifyResource DiscountCode(integer $id = null)
20+ *
21+ */
22+ class PriceRule extends ShopifyResource
23+ {
24+ /**
25+ * @inheritDoc
26+ */
27+ public $ resourceKey = 'price_rule ' ;
28+
29+ /**
30+ * @inheritDoc
31+ */
32+ public $ countEnabled = false ;
33+
34+ /**
35+ * @inheritDoc
36+ */
37+ protected $ childResource = array (
38+ 'DiscountCode '
39+ );
40+ }
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ class ShopifySDK
179179 'Policy ' ,
180180 'Product ' ,
181181 'ProductVariant ' ,
182+ 'PriceRule ' ,
182183 'RecurringApplicationCharge ' ,
183184 'Redirect ' ,
184185 'Report ' ,
@@ -205,6 +206,7 @@ class ShopifySDK
205206 'OrderRisk ' => 'Order ' ,
206207 'ProductImage ' => 'Product ' ,
207208 'ProductVariant ' => 'Product ' ,
209+ 'DiscountCode ' => 'PriceRule ' ,
208210 'Province ' => 'Country ' ,
209211 'Refund ' => 'Order ' ,
210212 'Transaction ' => 'Order ' ,
You can’t perform that action at this time.
0 commit comments