diff --git a/packages/Webkul/Discount/src/Helpers/Discount.php b/packages/Webkul/Discount/src/Helpers/Discount.php index 1b041ed7d..5cc053c97 100644 --- a/packages/Webkul/Discount/src/Helpers/Discount.php +++ b/packages/Webkul/Discount/src/Helpers/Discount.php @@ -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; diff --git a/packages/Webkul/Product/src/Helpers/ProductImage.php b/packages/Webkul/Product/src/Helpers/ProductImage.php index cc62c1a9d..bd0fe1b7e 100755 --- a/packages/Webkul/Product/src/Helpers/ProductImage.php +++ b/packages/Webkul/Product/src/Helpers/ProductImage.php @@ -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'), diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php index aa13372fa..521af556b 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php @@ -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(); + }); } } })