Skip to content

Commit

Permalink
Update placement and text
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcallender committed Nov 10, 2024
1 parent 4b2b47e commit c6d9b31
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 35 deletions.
68 changes: 34 additions & 34 deletions src/templates/_components/app/summary-cart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@
</div>
{% endif %}

{% if not cart.shippingAddressId %}
{% if craft.fostercheckout.getOption('enableEstimatedShipping') %}
{% include 'foster-checkout/_components/app/estimated-shipping' %}
{% endif %}

{% if craft.fostercheckout.getOption('enableFreeShippingMessage') %}
<p class="max-w-[210px] -mt-[8px] text-sm text-gray-500">
{{ 'Add'|t('foster-checkout') }}
<strong class="text-black">$24.15</strong>
{{ 'for FREE shipping, or choose FREE Ship to Store.'|t('foster-checkout') }}
</p>
{% endif %}

{% else %}
<div class="flex justify-between items-center gap-4">
<dt class="text-gray-500">{{ 'Shipping & handling'|t('foster-checkout') }}</dt>
<dd class="text-right text-black">{{ cart.totalShippingCostAsCurrency }}</dd>
</div>
{% endif %}


<div class="flex justify-between items-center gap-4">
<dt class="text-gray-500">{{ 'Estimated tax'|t('foster-checkout') }}</dt>
<dd class="text-right text-black">{{ cart.totalTaxAsCurrency }}</dd>
</div>

{% include 'foster-checkout/_components/app/coupon-code' %}

{% if craft.giftVoucher is defined %}

{# Check for applied / redeemed gift card vouchers in orders #}
Expand All @@ -24,7 +52,7 @@

{% if voucherCodes|length >= 1 %}
<div class="border-gray-400 border-b flex flex-col space-y-2 pb-4">
<h3 class="font-semibold text-gray-800">{{ 'Redeemed Gift Vouchers'|t('foster-checkout') }}</h3>
<h3 class="font-semibold text-gray-800">{{ 'Gift cards applied'|t('foster-checkout') }}</h3>

{% for code in voucherCodes %}

Expand All @@ -36,14 +64,14 @@
{{ actionInput('gift-voucher/cart/remove-code') }}
<input type="hidden" name="voucherCode" value="{{ code }}">
<button
type="submit"
class="inline-flex justify-start items-center gap-2 text-sm underline text-gray-500 hover:no-underline hover:text-gray-700"
type="submit"
class="inline-flex justify-start items-center gap-2 text-sm underline text-gray-500 hover:no-underline hover:text-gray-700"
>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="14" viewBox="0 0 12 14"
class="fill-current">
class="fill-current">
<path
d="M2.31807 13.0996C2.01032 13.0996 1.74346 12.9871 1.51751 12.7619C1.29155 12.5367 1.17857 12.2708 1.17857 11.9641V2.5319H0.42749V1.39638H3.73221V0.824646H8.26372V1.39638H11.5724V2.5319H10.8213V11.9641C10.8213 12.2708 10.7084 12.5367 10.4824 12.7619C10.2565 12.9871 9.9896 13.0996 9.68184 13.0996H2.31807ZM4.06481 10.5627H5.13257V3.9127H4.06481V10.5627ZM6.86734 10.5627H7.93909V3.9127H6.86734V10.5627Z"
fill="#6B7280"/>
d="M2.31807 13.0996C2.01032 13.0996 1.74346 12.9871 1.51751 12.7619C1.29155 12.5367 1.17857 12.2708 1.17857 11.9641V2.5319H0.42749V1.39638H3.73221V0.824646H8.26372V1.39638H11.5724V2.5319H10.8213V11.9641C10.8213 12.2708 10.7084 12.5367 10.4824 12.7619C10.2565 12.9871 9.9896 13.0996 9.68184 13.0996H2.31807ZM4.06481 10.5627H5.13257V3.9127H4.06481V10.5627ZM6.86734 10.5627H7.93909V3.9127H6.86734V10.5627Z"
fill="#6B7280"/>
</svg>
<span class="inline">{{ 'Remove'|t('foster-checkout') }}</span>
</button>
Expand All @@ -58,34 +86,6 @@

{% endif %}

{% if not cart.shippingAddressId %}
{% if craft.fostercheckout.getOption('enableEstimatedShipping') %}
{% include 'foster-checkout/_components/app/estimated-shipping' %}
{% endif %}

{% if craft.fostercheckout.getOption('enableFreeShippingMessage') %}
<p class="max-w-[210px] -mt-[8px] text-sm text-gray-500">
{{ 'Add'|t('foster-checkout') }}
<strong class="text-black">$24.15</strong>
{{ 'for FREE shipping, or choose FREE Ship to Store.'|t('foster-checkout') }}
</p>
{% endif %}

{% else %}
<div class="flex justify-between items-center gap-4">
<dt class="text-gray-500">{{ 'Shipping & handling'|t('foster-checkout') }}</dt>
<dd class="text-right text-black">{{ cart.totalShippingCostAsCurrency }}</dd>
</div>
{% endif %}


<div class="flex justify-between items-center gap-4">
<dt class="text-gray-500">{{ 'Estimated tax'|t('foster-checkout') }}</dt>
<dd class="text-right text-black">{{ cart.totalTaxAsCurrency }}</dd>
</div>

{% include 'foster-checkout/_components/app/coupon-code' %}

{% if step|default('') != 'payment' %}
<div class="flex justify-between items-center gap-4">
<dt class="font-semibold text-black">{{ 'Estimated total'|t('foster-checkout') }}</dt>
Expand Down
20 changes: 19 additions & 1 deletion src/templates/checkout/payment.twig
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@

{% if craft.giftVoucher is defined %}


<div class="my-6" v-scope="{ sending: false }">

<h3 class="px-4 mb-4 font-semibold xl:px-0">
Expand Down Expand Up @@ -245,6 +244,25 @@
</button>
</form>
</div>



{# Check for applied / redeemed gift card vouchers in orders #}

{% set voucherCodes = craft.giftVoucher.getVoucherCodes() %}

{% if voucherCodes|length >= 1 %}
<div class="border-gray-400 border-b flex flex-col space-y-2 py-4">

{% for code in voucherCodes %}

<div class="flex justify-between items-center">
<p class="text-gray-500">{{ 'Gift cards currently applied to your order'|t('foster-checkout') }}: {{ code }} ({{ craft.giftVoucher.codes().codeKey(code).one().currentAmount | currency }})</p>
</div>

{% endfor %}
</div>
{% endif %}
</div>
{% endif %}

Expand Down

0 comments on commit c6d9b31

Please sign in to comment.