Last active
August 27, 2017 03:18
-
-
Save re-dev/355eadb882f63428030d259ec6278436 to your computer and use it in GitHub Desktop.
Customising a Squarespace Checkout Confirmation Page and Redirect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var insertThis = "<h1>Thank you, your order is confirmed.</h1><p>Order Number: <strong>#000{orderId}</strong></p><p>Thank you for your order! Your payment of <strong>${orderGrandTotal}</strong> has been confirmed. A confirmation email has been sent to you at <a href='mailto:{customerEmailAddress}'>{customerEmailAddress}</a>.</p>" | |
$("#confirmed-page").after(insertThis).css("display","none"); | |
$(document).ready(function() { | |
// redirect based on order value | |
var whichPackage = {orderGrandTotal} | |
setTimeout(function(){ | |
if(whichPackage > 1000 ){ | |
// redirect customer to URL xxxx | |
//alert("redirect to URL xxxx") | |
window.location.href = "xxxx"; | |
} else { | |
// redirect customer to URL yyyy | |
// alert("redirect to yyyy"); | |
window.location.href = "yyyy"; | |
} | |
},7000); // redirect after 7 seconds | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment