Skip to content

Instantly share code, notes, and snippets.

@makfruit
Created August 1, 2012 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makfruit/3225040 to your computer and use it in GitHub Desktop.
Save makfruit/3225040 to your computer and use it in GitHub Desktop.
A drop-in script for Ecwid for redirection a visitor from featured products page to the main store page
<script>
var ecwid_ProductBrowserURL = 'http://www.example.com'; // change it to your store page URL
if (typeof(Ecwid) == 'object') {
// Add handler for Ecwid's OnPageLoad event
Ecwid.OnPageLoad.add(function(page) {
// If any Ecwid link is clicked, open the corresponding Ecwid page in the main product browser
if (window.location.hash.match(/\/~\//) !== null) {
window.location = ecwid_ProductBrowserURL + window.location.hash;
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment