Skip to content

Commit

Permalink
Merge pull request #2 from bagisto/master
Browse files Browse the repository at this point in the history
base śro, 13 lis 2019, 16:42:58 CET
  • Loading branch information
darekmeco authored Nov 13, 2019
2 parents 6e491d4 + 58a0bad commit 3c94f26
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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;
});
},
Expand Down

0 comments on commit 3c94f26

Please sign in to comment.