Merge pull request #1078 from rahulshukla-webkul/development

flash message for discount & error
This commit is contained in:
Jitendra Singh 2019-06-20 11:04:55 +05:30 committed by GitHub
commit f1f7d03f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 7 deletions

View File

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

View File

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

View File

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