Skip to content

Instantly share code, notes, and snippets.

@makfruit
Created December 20, 2011 10:37
Show Gist options
  • Select an option

  • Save makfruit/1501134 to your computer and use it in GitHub Desktop.

Select an option

Save makfruit/1501134 to your computer and use it in GitHub Desktop.
A script for Ecwid to redirect a customer after placing an order to a custom 'thank you' page
var confirmationPageURL = "http://google.com";
// Add handler for Ecwid's OnPageLoad event
if (
typeof(Ecwid) == 'object'
&& typeof(Ecwid.OnPageLoad) == 'object'
) {
Ecwid.OnPageLoad.add(function(page) {
// Redirect user if needed
if (
typeof(page) == 'object'
&& 'ORDER_CONFIRMATION' == page.type
) {
window.location = confirmationPageURL;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment