Issue 1643 fix

This commit is contained in:
KobbyKnight 2019-11-11 16:28:47 +00:00
parent 3cbbbbe340
commit e91049ebf3
1 changed files with 5 additions and 2 deletions

View File

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