Merge pull request #1078 from rahulshukla-webkul/development
flash message for discount & error
This commit is contained in:
commit
f1f7d03f6f
|
|
@ -327,11 +327,16 @@ abstract class Discount
|
|||
$result = true;
|
||||
|
||||
foreach ($conditions as $condition) {
|
||||
$actual_value = ${$condition->attribute};
|
||||
$test_value = $condition->value;
|
||||
$test_condition = $condition->condition;
|
||||
if (isset($condition->attribute))
|
||||
$actual_value = ${$condition->attribute};
|
||||
|
||||
if ($condition->type == 'numeric' || $condition->type == 'string' || $condition->type == 'text') {
|
||||
if (isset($condition->value))
|
||||
$test_value = $condition->value;
|
||||
|
||||
if (isset($condition->condition))
|
||||
$test_condition = $condition->condition;
|
||||
|
||||
if (isset($condition->type) && ($condition->type == 'numeric' || $condition->type == 'string' || $condition->type == 'text')) {
|
||||
if ($test_condition == '=') {
|
||||
if ($actual_value != $test_value) {
|
||||
$result = false;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ProductImage extends AbstractProduct
|
|||
];
|
||||
}
|
||||
|
||||
if (! count($images)) {
|
||||
if (! $product->parent_id && ! count($images)) {
|
||||
$images[] = [
|
||||
'small_image_url' => asset('vendor/webkul/ui/assets/images/product/small-product-placeholder.png'),
|
||||
'medium_image_url' => asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.png'),
|
||||
|
|
|
|||
|
|
@ -519,7 +519,11 @@
|
|||
.then(function(response) {
|
||||
this_this.$emit('onApplyCoupon')
|
||||
})
|
||||
.catch(function(error) {});
|
||||
.catch(function(error) {
|
||||
window.flashMessages = [{'type' : 'alert-error', 'message' : error.response.data.message}];
|
||||
|
||||
this_this.$root.addFlashMessages();
|
||||
});
|
||||
},
|
||||
|
||||
removeCoupon: function () {
|
||||
|
|
@ -529,7 +533,11 @@
|
|||
.then(function(response) {
|
||||
this_this.$emit('onRemoveCoupon')
|
||||
})
|
||||
.catch(function(error) {});
|
||||
.catch(function(error) {
|
||||
window.flashMessages = [{'type' : 'alert-error', 'message' : error.response.data.message}];
|
||||
|
||||
this_this.$root.addFlashMessages();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue