From 3d53a221ef69ff7ea6fa1e4fab66c6330d4d6f99 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 17 Jul 2019 16:18:10 +0530 Subject: [PATCH] Has options check applied on frontend for options related to select and multiselect attributes --- .../views/promotions/cart-rule/edit.blade.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 0ccc83e43..b1b6dc50c 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 @@ -560,12 +560,19 @@ this.attribute_values = JSON.parse(JSON.parse(data.actions).attribute_conditions).attributes; + // creating the options and the has option param on the frontend for (i in this.attribute_values) { for (j in this.attribute_input) { if (this.attribute_input[j].code == this.attribute_values[i].attribute) { - this.attribute_values[i].has_options = true; + if (this.attribute_input[j].has_options == true) { + this.attribute_values[i].has_options = true; - this.attribute_values[i].options = this.attribute_input[j].options; + this.attribute_values[i].options = this.attribute_input[j].options; + } else { + this.attribute_values[i].has_options = false; + + this.attribute_values[i].options = null; + } } } }