diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index dbde85f72..65595ab9c 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -686,12 +686,12 @@ return [ 'image' => 'Image', 'content' => 'Content', 'channels' => 'Channel', - 'created-success' => 'Slider Item Created Successfully', - 'created-fault' => 'Error In Creating Slider Item', - 'update-success' => 'Slider Item Successfully Updated', - 'update-fail' => 'Slider Cannot Be Updated', - 'delete-success' => 'Cannot Delete The Last Slider Item', - 'delete-fail' => 'Slider Item Successfully Deleted' + 'created-success' => 'Slider item created successfully', + 'created-fault' => 'Error in creating slider item', + 'update-success' => 'Slider item successfully updated', + 'update-fail' => 'Slider cannot be updated', + 'delete-success' => 'Cannot delete last llider item', + 'delete-fail' => 'Slider item successfully deleted' ], 'tax-categories' => [ @@ -914,7 +914,7 @@ return [ 'update-success' => 'Success! rule updated', 'update-coupon-success' => 'Success! rule updated along with coupon', 'update-failed' => 'Error! cannot update', - 'delete-success' => 'Sucess! rule deleted', + 'delete-success' => 'Success! rule deleted', 'delete-failed' => 'Error! cannot delete', 'coupon-applied' => 'Coupon used', 'coupon-failed' => 'Coupon failed to apply', 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 7926c31c4..6086c1d61 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 @@ -582,10 +582,10 @@ this.match_criteria = this.conditions_list.pop().criteria; } - if (JSON.parse(JSON.parse(data.actions).attribute_conditions)) { - this.category_values = JSON.parse(JSON.parse(data.actions).attribute_conditions).categories; + if (JSON.parse(data.actions).attribute_conditions) { + this.category_values = JSON.parse(data.actions).attribute_conditions.categories; - this.attribute_values = JSON.parse(JSON.parse(data.actions).attribute_conditions).attributes; + this.attribute_values = JSON.parse(data.actions).attribute_conditions.attributes; if (this.category_values == null) { this.category_values = []; @@ -595,8 +595,6 @@ this.attribute_values = []; } - console.log(this.category_values); - // creating options and has option param on the frontend for (i in this.attribute_values) { for (j in this.attribute_input) { diff --git a/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php b/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php index 4370c6fbf..ccfc78071 100644 --- a/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php +++ b/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php @@ -177,7 +177,7 @@ class CartRuleController extends Controller $attribute_conditions = json_decode($attribute_conditions); - if (! isset($attribute_conditions) || $attribute_conditions == "[]" || $attribute_conditions == "" || ! (count($attribute_conditions->categories) && count($attribute_conditions->attributes))) { + if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) && count($attribute_conditions->attributes))) { $data['uses_attribute_conditions'] = 0; $data['actions'] = [ @@ -192,7 +192,7 @@ class CartRuleController extends Controller 'action_type' => $data['action_type'], 'disc_amount' => $data['disc_amount'], 'disc_quantity' => $data['disc_quantity'], - 'attribute_conditions' => $attribute_conditions + 'attribute_conditions' => json_encode($attribute_conditions) ]; } @@ -545,7 +545,7 @@ class CartRuleController extends Controller return response()->json(['message' => true], 200); } else { - session()->flash('success', trans('admin::app.promotion.status.delete-failed')); + session()->flash('error', trans('admin::app.promotion.status.delete-failed')); return response()->json(['message' => false], 400); }