From 1aab4ccfe34c504b6f27895d5f485892303f6291 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Sat, 7 Sep 2019 04:48:27 +0530 Subject: [PATCH] more normalization of cart rule form variables --- .../views/promotions/cart-rule/create.blade.php | 3 +-- .../views/promotions/cart-rule/edit.blade.php | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php index 5fd824bad..5299e1c80 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php @@ -481,7 +481,6 @@ conditions: @json($cart_rule[0]).conditions, cart_input: @json($cart_rule[0]).attributes, actions: @json($cart_rule[0]).actions, - conditions_list:[], cart_object: { attribute: [], condition: [], @@ -604,7 +603,7 @@ this.all_attributes = JSON.stringify(this.all_attributes); - if (this.conditions_list.length != 0) { + if (this.conditions_list != null && this.conditions_list.length != 0) { this.conditions_list.push({'criteria': this.match_criteria}); this.all_conditions = JSON.stringify(this.conditions_list); diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php index faf49e9d7..69a6e4008 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php @@ -228,7 +228,7 @@ - + @@ -663,13 +663,7 @@ }, detectApply() { - if (this.apply == 'percent_of_product' || this.apply == 'buy_a_get_b') { - this.apply_prct = true; - this.apply_amt = false; - } else if (this.apply == 'fixed_amount' || this.apply == 'fixed_amount_cart') { - this.apply_prct = false; - this.apply_amt = true; - } + return; }, enableCondition(event, index) {