Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: redirect user to legacy checkout when voucher is invalid for leg…
Browse files Browse the repository at this point in the history
…acysystem
  • Loading branch information
Muhammad Noyan Aziz authored and Muhammad Noyan Aziz committed Jul 1, 2024
1 parent c211842 commit e796998
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ecommerce/coupons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def get(self, request): # pylint: disable=too-many-statements
voucher = Voucher.objects.get(code=code)
except Voucher.DoesNotExist:
msg = 'No voucher found with code {code}'.format(code=code)
return render(request, template_name, {'error': _(msg)})
messages.warning(self.request, _(msg))
redirect_url = get_payment_microfrontend_or_basket_url(self.request) + "?coupon_redeem_redirect=1"
redirect_url = add_stripe_flag_to_url(redirect_url, self.request)
return HttpResponseRedirect(redirect_url)

try:
product = StockRecord.objects.get(partner_sku=sku).product
Expand Down

0 comments on commit e796998

Please sign in to comment.