Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings for showing and customising made a mistake section on or… #33

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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