Redirect to a Thank You Page After Purchase

What does this code do?

This code snippet will allow you to redirect to a Thank You page after a customer has completed a purchase on your website.

 

Create the Redirect Page

The first step is to create the page you would like the customer to be redirect to. Place this in the Not Linked section of your site and take note of the url.

 

Code Snippets

Copy and paste this code into Settings > Advanced > Code Injection > Order Confirmation Page

Redirect After a Given Amount of Time

<meta http-equiv="refresh" content="10;URL='/thank-you'" />

Change the 10 to match the number of seconds you would like the redirect to happen after. Then change the words “thank-you” to the url of your redirect page. Be sure not to delete any quotation marks or slashes.

Redirect Immediately

<meta http-equiv="refresh" content="0; url='/thank-you'">
</meta>
<style>
  #_confirmationpage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 2147483646;
  }
</style>
<div id="_confirmationpage"></div>

Even though we have put the time to 0 seconds, it will still show the order confirmation page briefly. So I have added code to put up a white screen overtop the confirmation page as it redirects.

Change the words “thank-you” to the url of your redirect page. Be sure not to delete any quotation marks or slashes. Feel free to also edit the background to whichever colour you would like.

 

How To Use It

  1. Create the page you would like your customers to be redirected to.

  2. Copy and paste the code as indicated above.

  3. Edit the delay, url, and/or background colour.

Rebecca Grace

Rebecca Grace is a Squarespace CSS Expert and Website Designer.

https://rebeccagracedesigns.com
Previous
Previous

Slideshow-Like Testimonial Section

Next
Next

Change the Newsletter Form Button Colour