Skip to content

Commit

Permalink
Merge pull request #50 from FosterCommerce/fix/regression-bugs-gift-v…
Browse files Browse the repository at this point in the history
…oucher

fix: wrong voucher amount used
  • Loading branch information
nedu64 authored Nov 11, 2024
2 parents c6177f4 + ac58e39 commit 02c15d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/templates/checkout/payment.twig
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
<div class="border-gray-400 border-b flex flex-col space-y-2 py-4 px-4 xl:px-0">
{% if voucherCodes|length == 1 %}
{% set currentAmount = craft.giftVoucher.codes().codeKey(voucherCodes[0]).one().currentAmount %}
{% set appliedAmount = (cart.storedItemTotal - currentAmount) <= 0 ? currentAmount - cart.storedItemTotal : currentAmount %}
{% set appliedAmount = cart.storedItemTotal < currentAmount ? cart.storedItemTotal : currentAmount %}
<div class="flex justify-between items-center">
<p class="text-gray-500">{{ 'Gift cards currently applied to your order'|t('foster-checkout') }}: {{ voucherCodes[0] }} ({{ appliedAmount | currency }})</p>
</div>
Expand Down

0 comments on commit 02c15d0

Please sign in to comment.