Merge pull request #1755 from KobbyKnight/master

Issue 1643 fix
This commit is contained in:
Jitendra Singh 2019-11-13 16:09:01 +05:30 committed by GitHub
commit 58a0bad4c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -608,7 +608,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');
@ -618,7 +618,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;
});
},