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:
Jitendra Singh 2019-09-06 17:15:41 +05:30 committed by GitHub
commit 449f50ebfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 15 deletions

View File

@ -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',

View File

@ -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) {

View File

@ -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);
}