diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php
index 2526ddb7d..4f7a817fd 100755
--- a/packages/Webkul/Admin/src/Resources/lang/en/app.php
+++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php
@@ -817,8 +817,8 @@ return [
'save' => 'Save',
'select-cart-attr' => 'Select Cart Attribute',
'select-products' => 'How to choose products ?',
- 'select-category' => 'Select Categories',
- 'select-attribute' => 'Select Attributes',
+ 'select-category' => 'Select by Categories',
+ 'select-attribute' => 'Select by Attributes',
'general-info' => [
'sku-like' => 'SKU Like',
'on-shipping' => 'If applied on shipping',
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 ea74d2646..bd0afbbbf 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
@@ -347,56 +347,29 @@
-
- @{{ category_values }}
- {{--
-
-
-
-
--}}
+
-
@@ -500,6 +473,11 @@
category_values: null,
attribute_list: [],
+ attr_object: {
+ attribute: null,
+ condition: null,
+ value: []
+ },
attribute_input: @json($cart_rule[3]),
attribute_options: [],
attribute_values: []
@@ -545,6 +523,16 @@
}
},
+ addAttributeCondition() {
+ this.attribute_list.push(this.attr_object);
+
+ this.attr_object = {
+ attribute: null,
+ condition: null,
+ value: []
+ };
+ },
+
checkAutogen() {
},
@@ -568,6 +556,17 @@
}
},
+ enableAttributeCondition (event, index) {
+ selectedIndex = event.target.selectedIndex - 1;
+
+ for(i in this.attribute_input) {
+ if (i == selectedIndex) {
+ this.attribute_list[index].type = this.attribute_input[i].type;
+ console.log(this.attribute_list[index].type);
+ }
+ }
+ },
+
// useCoupon() {
// if (this.use_coupon == 0) {
// this.auto_generation = null;
@@ -580,8 +579,8 @@
this.conditions_list.splice(index, 1);
},
- removeCat(index) {
- this.cats.splice(index, 1);
+ removeAttr(index) {
+ this.attribute_list.splice(index, 1);
},
onSubmit: function (e) {
diff --git a/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php b/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php
index 6c8c09c3d..aec13c548 100644
--- a/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php
+++ b/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php
@@ -80,6 +80,8 @@ class CartRuleController extends Controller
}
/**
+ * Loads the cart rule index page
+ *
* @return view
*/
public function index()
@@ -88,6 +90,8 @@ class CartRuleController extends Controller
}
/**
+ * Loads the cart rule create page
+ *
* @return view
*/
public function create()
@@ -96,6 +100,8 @@ class CartRuleController extends Controller
}
/**
+ * Stores the response from cart rule store page to datastore
+ *
* @return redirect
*/
public function store()
@@ -288,6 +294,8 @@ class CartRuleController extends Controller
}
/**
+ * Loads the cart rule edit page
+ *
* @return view
*/
public function edit($id)
@@ -303,6 +311,8 @@ class CartRuleController extends Controller
}
/**
+ * Collects the response from cart rule update page and update datastore
+ *
* @return redirect
*/
public function update($id)