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 @@ -112,6 +112,7 @@ class ShopifySDK
112
112
'Policy ' ,
113
113
'Product ' ,
114
114
'ProductVariant ' ,
115
+ 'PriceRule ' ,
115
116
'RecurringApplicationCharge ' ,
116
117
'Redirect ' ,
117
118
'ScriptTag ' ,
@@ -137,6 +138,7 @@ class ShopifySDK
137
138
'OrderRisk ' => 'Order ' ,
138
139
'ProductImage ' => 'Product ' ,
139
140
'ProductVariant ' => 'Product ' ,
141
+ 'DiscountCode ' => 'PriceRule ' ,
140
142
'Province ' => 'Country ' ,
141
143
'Refund ' => 'Order ' ,
142
144
'Transaction ' => 'Order ' ,
You can’t perform that action at this time.
0 commit comments