From da093662dbfd7d07b37fe8b7f9dcb72f56ec1775 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Mon, 12 Aug 2019 06:56:21 +0530 Subject: [PATCH] Catalog rule implementation in progress --- .../promotions/catalog-rule/create.blade.php | 12 +- .../promotions/catalog-rule/edit.blade.php | 43 ++- .../Http/Controllers/CustomerController.php | 2 +- .../Discount/src/Config/rule-conditions.php | 20 +- .../{ => Cart}/ConvertXToProductId.php | 11 +- .../src/Helpers/{ => Cart}/CouponAbleRule.php | 4 +- .../src/Helpers/{ => Cart}/Discount.php | 45 ++- .../Helpers/{ => Cart}/NonCouponAbleRule.php | 4 +- .../Helpers/{ => Cart}/ValidatesDiscount.php | 2 +- .../Discount/src/Helpers/Catalog/Apply.php | 68 +++++ .../Helpers/Catalog/ConvertXToProductId.php | 272 ++++++++++++++++++ .../Discount/src/Helpers/Catalog/Sale.php | 107 +++++++ .../src/Helpers/Catalog/SyncPreviousRules.php | 0 .../Discount/src/Helpers/FindProducts.php | 71 ----- .../Http/Controllers/CartRuleController.php | 2 +- .../Controllers/CatalogRuleController.php | 38 +-- .../src/Models/CatalogRuleCustomerGroups.php | 6 +- .../Http/Controllers/OnepageController.php | 9 +- .../assets/js/components/datetime.vue | 4 + 19 files changed, 562 insertions(+), 158 deletions(-) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/ConvertXToProductId.php (96%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/CouponAbleRule.php (95%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/Discount.php (97%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/NonCouponAbleRule.php (88%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/ValidatesDiscount.php (97%) create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/Apply.php create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/ConvertXToProductId.php create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/Sale.php create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/SyncPreviousRules.php delete mode 100644 packages/Webkul/Discount/src/Helpers/FindProducts.php diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php index e6032fd8b..1e9df1516 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php @@ -136,7 +136,11 @@ - + + + + @@ -159,7 +163,7 @@ - Add Attribute Condition + {{ __('admin::app.promotion.add-attr-condition') }} @@ -256,6 +260,7 @@ }, mounted () { + console.log(this.attribute_input); }, methods: { @@ -336,6 +341,7 @@ for(i in this.attribute_input) { if (i == selectedIndex) { if (this.attribute_input[i].has_options == true) { + this.selectedIndex this.attribute_values[index].options = this.attribute_input[i].options; } @@ -355,7 +361,7 @@ }, removeAttr(index) { - this.conditions_list.splice(index, 1); + this.attribute_values.splice(index, 1); }, removeCat(index) { diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php index 3bd7b26d7..91db3e8be 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php @@ -12,7 +12,7 @@ @push('scripts')