From 2af7a4c494216c1bc4f95c0d97538a6c5e01f78a Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Thu, 12 Sep 2024 15:24:33 +0300 Subject: [PATCH] =?UTF-8?q?Adding=20the=20=E2=80=9Cpromotional=E2=80=9D=20?= =?UTF-8?q?feature=20for=20the=20price=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/class-wc-retailcrm-upload-discount-price.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/include/class-wc-retailcrm-upload-discount-price.php b/src/include/class-wc-retailcrm-upload-discount-price.php index 0f47a6b..c6973d6 100644 --- a/src/include/class-wc-retailcrm-upload-discount-price.php +++ b/src/include/class-wc-retailcrm-upload-discount-price.php @@ -188,7 +188,8 @@ if (!class_exists('WC_Retailcrm_Upload_Discount_Price')): 'description' => __('Promotional price type for Woocommerce store, generated automatically. Necessary for correct synchronization work when loyalty program is enabled (Do not delete. Do not deactivate)', 'retailcrm'), - 'ordering' => 999 + 'ordering' => 999, + 'promo' => true ]; if (isset($defaultPrice['geo'])) { @@ -212,8 +213,9 @@ if (!class_exists('WC_Retailcrm_Upload_Discount_Price')): if (!$response instanceof WC_Retailcrm_Response || !$response['success']) { return 'Error creating price type'; } - } elseif ($discountPriceType['active'] === false) { + } elseif ($discountPriceType['active'] === false || $discountPriceType['promo'] === false) { $discountPriceType['active'] = true; + $discountPriceType['promo'] = true; $response = $this->apiClient->editPriceType($discountPriceType);