Skip to content

Commit

Permalink
Merge pull request #33 from FosterCommerce/made-a-mistake-message
Browse files Browse the repository at this point in the history
Add settings for showing and customising made a mistake section on or…
  • Loading branch information
peteeveleigh authored Sep 19, 2024
2 parents e47cc50 + 5fe2018 commit 3f8907c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
12 changes: 12 additions & 0 deletions src/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
// Whether or not to enable CSS page transitions
//(see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility for browser compatibility)
'enablePageTransitions' => false,

// Whether or not to show the "Made a mistake" function on the order completed page
// If disabled then the heading and text will not be displayed
'enableMadeAMistake' => false,
],
// Branding Settings
'branding' => [
Expand Down Expand Up @@ -127,5 +131,13 @@
'elementHandle' => '',
'fieldHandle' => '',
],
'mistakeHeading' => [
'elementHandle' => '',
'fieldHandle' => '',
],
'mistakeText' => [
'elementHandle' => '',
'fieldHandle' => '',
],
],
];
16 changes: 8 additions & 8 deletions src/templates/checkout/order.twig
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@

</div>

{% if craft.fostercheckout.getOption('enableMadeAMistake') %}
<div class="hidden lg:block">
<h3 class="font-semibold text-2xl">Made a mistake?</h3>
<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">
<p>
{{ 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>
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">
Expand All @@ -117,7 +117,7 @@
</form>
</div>
</div>

{% endif %}
</main>

<aside>
Expand Down

0 comments on commit 3f8907c

Please sign in to comment.