File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @see https://help.shopify.com/api/reference/discounts/discountcode Shopify API Reference for PriceRule
4+ */
5+
6+ namespace PHPShopify ;
7+
8+
9+ /**
10+ * --------------------------------------------------------------------------
11+ * DiscountCode -> Batch action
12+ * --------------------------------------------------------------------------
13+ *
14+ */
15+
16+ class Batch extends ShopifyResource
17+ {
18+ /**
19+ * @inheritDoc
20+ */
21+ protected $ resourceKey = 'batch ' ;
22+
23+ protected function getResourcePath ()
24+ {
25+ return $ this ->resourceKey ;
26+ }
27+
28+ protected function wrapData ($ dataArray , $ dataKey = null )
29+ {
30+ return ['discount_codes ' => $ dataArray ];
31+ }
32+
33+ }
Original file line number Diff line number Diff line change 1717 * @property-read ShopifyResource $DiscountCode
1818 *
1919 * @method ShopifyResource DiscountCode(integer $id = null)
20+ * @method ShopifyResource Batch()
2021 *
2122 */
2223class PriceRule extends ShopifyResource
@@ -30,6 +31,7 @@ class PriceRule extends ShopifyResource
3031 * @inheritDoc
3132 */
3233 protected $ childResource = array (
33- 'DiscountCode '
34+ 'DiscountCode ' ,
35+ 'Batch ' ,
3436 );
35- }
37+ }
You can’t perform that action at this time.
0 commit comments