less than a minute read • Updated 9 minutes ago
Redirect customers after checkout instead of showing the receipt
How to redirect customers to your own page after checkout instead of the Foxy receipt.
If you'd like to redirect the customer to a webpage (perhaps a Thank You page on your site), you can use this snippet to do so.
Step 1: Apply the snippet to your configuration
If you would like the receipt to redirect to your page only the very first time, copy the following code to your computer's clipboard:
{% if first_receipt_display %}
<script>
window.location.href = "https://your-desired-url-here/";
</script>
{% endif %}If you want to redirect the customer every time the receipt is viewed (including when the View Web Receipt link is clicked from the email receipt), copy this version:
<script>
window.location.href = "https://your-desired-url-here/";
</script>In the Foxy admin (https://admin.foxy.io), go to Settings > Receipts and edit the Custom template for web receipt.
The Custom template for web receipt field shows the default until you add your own.
Paste the code you copied into the
<head>section.
Step 2: Customise conditions
Update the link
the-desired-url-hereto your desired redirect URL.Scroll down until you see the Update Template button and click to save.
You can run a test by going into the Foxy transactions log and click (view) under the transaction id to view the current version of the web receipt. Note that if you chose the first code snippet, the receipt should not redirect ― you'll can put through a test transaction to test this option.