Issue 1643 fix
This commit is contained in:
parent
3cbbbbe340
commit
e91049ebf3
|
|
@ -564,7 +564,7 @@
|
|||
methods: {
|
||||
onSubmit: function() {
|
||||
var this_this = this;
|
||||
|
||||
const emptyCouponErrorText = "Please enter a coupon code";
|
||||
axios.post('{{ route('shop.checkout.check.coupons') }}', {code: this_this.coupon_code})
|
||||
.then(function(response) {
|
||||
this_this.$emit('onApplyCoupon');
|
||||
|
|
@ -574,7 +574,10 @@
|
|||
.catch(function(error) {
|
||||
this_this.couponChanged = true;
|
||||
|
||||
this_this.error_message = error.response.data.message;
|
||||
this_this.error_message = (error.response.data.message === "The given data was invalid.")?
|
||||
emptyCouponErrorText :
|
||||
(error.response.data.message === "Cannot Apply Coupon")?
|
||||
"Sorry, this Coupon code is invalid":error.response.data.message;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue