Skip to content

Commit

Permalink
Clean up order page
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcallender committed Sep 19, 2024
1 parent abcb270 commit e4722db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 55 deletions.
2 changes: 1 addition & 1 deletion src/templates/_components/app/summary-order.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div class="flex justify-between items-center gap-4">
<dt class="font-semibold text-black">{{ 'Subtotal After Discount'|t('foster-checkout') }}</dt>
<dd class="font-semibold text-right text-black">{{ order.subTotalAsCurrency }}</dd>
<dd class="font-semibold text-right text-black">{{ order.subtotalAsCurrency }}</dd>
</div>
{% endif %}

Expand Down
60 changes: 7 additions & 53 deletions src/templates/checkout/order.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'foster-checkout/_layouts/default' %}
{% set order = craft.orders.uid(craft.app.request.getParam('number')).one() ?? null %}
{% set order = craft.orders.number(craft.app.request.getParam('number')).one() ?? null %}
{% if not order %}
{% exit 404 %}
{% endif %}
Expand Down Expand Up @@ -93,29 +93,14 @@

{% if craft.fostercheckout.getOption('enableMadeAMistake') %}
<div class="hidden lg:block">
<h3 class="font-semibold text-2xl">{{ craft.checkout.note('madeAMistakeHeading') | default('Made a mistake?') }}</h3>
{% if craft.checkout.note('madeAMistakeHeading') %}
<h3 class="font-semibold text-2xl">{{ craft.checkout.note('madeAMistakeHeading') }}</h3>
{% endif %}
{% if craft.checkout.note('madeAMistakeMessage') %}
<div class="mt-6 space-y-2 text-gray-500">
{{ craft.checkout.note('madeAMistakeMessage') | default('<p>
If you have placed an order for the wrong item or something similar, you can cancel your order
by clicking “Review or Cancel Your Order”. Orders are processed quickly, so please cancel your order as soon
as possible after placement. Most orders can be canceled within one hour of placement.
</p>') | raw }}

{{ craft.checkout.note('madeAMistakeMessage') | raw }}
</div>

{# <div class="flex justify-start items-start gap-6 mt-8">
<form method="post">
{{ csrfInput() }}
{{ actionInput('fostercheckout/cancel-order') }}
{{ hiddenInput('uid', order.uid) }}
<button
type="submit"
class="inline-block min-w-[180px] px-4 py-3 font-medium text-[var(--brandColor)] text-center bg-white border border-[var(--brandColor)] rounded-xl"
>
Review or Cancel Your Order
</button>
</form>
</div> #}
{% endif %}
</div>
{% endif %}
</main>
Expand All @@ -142,37 +127,6 @@

</div>

{% include 'foster-checkout/_components/app/summary-order' with {
postalCode: '90210',
couponCode: '121212'
} %}

{% if craft.fostercheckout.getOption('enableMadeAMistake') %}
<div class="pt-8 border-t border-gray-250 lg:hidden">
<h3 class="font-semibold text-2xl">{{ craft.checkout.note('madeAMistakeHeading') | default('Made a mistake?') }}</h3>
<div class="mt-6 space-y-2 text-gray-500">
{{ craft.checkout.note('madeAMistakeMessage') | default('<p>
If you have placed an order for the wrong item or something similar, you can cancel your order
by clicking “Review or Cancel Your Order”. Orders are processed quickly, so please cancel your order as soon
as possible after placement. Most orders can be canceled within one hour of placement.
</p>') | raw }}
</div>

{# <div class="flex justify-start items-start gap-6 mt-8">
<form method="post">
{{ csrfInput() }}
{{ actionInput('fostercheckout/cancel-order') }}
{{ hiddenInput('uid', order.uid) }}
<button
type="submit"
class="inline-block min-w-[180px] px-4 py-3 font-medium text-[var(--brandColor)] text-center bg-white border border-[var(--brandColor)] rounded-xl"
>
Review or Cancel Your Order
</button>
</form>
</div> #}
</div>
{% endif %}
</div>
</aside>

Expand Down
2 changes: 1 addition & 1 deletion src/templates/checkout/payment.twig
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
{{ actionInput('commerce/payments/pay') }}
{{ redirectInput(craft.fostercheckout.getPath('checkout') ~ '/order') }}
{{ redirectInput(siteUrl(craft.fostercheckout.getPath('checkout') ~ '/order', {
number: cart.uid,
number: cart.number,
success: 'true'
})) }}
{{ hiddenInput('cancelUrl', siteUrl(craft.fostercheckout.getPath('checkout') ~ '/payment')|hash) }}
Expand Down

0 comments on commit e4722db

Please sign in to comment.