Merge pull request #1408 from prashant-webkul/development
JSON data parsing trimmed down from two levels to a single level in Cart rule update form
This commit is contained in:
commit
449f50ebfc
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue