Created
December 13, 2011 06:40
-
-
Save makfruit/1470943 to your computer and use it in GitHub Desktop.
A script for Ecwid to determine a product ID of a product page being displayed
This file contains 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
// Add handler for Ecwid's OnPageLoad event | |
if ( | |
typeof(Ecwid) == 'object' | |
&& typeof(Ecwid.OnPageLoad) == 'object' | |
) { | |
Ecwid.OnPageLoad.add(function(page) { | |
// Determine a product ID and do necessary actions | |
if ( | |
typeof(page) == 'object' | |
&& 'PRODUCT' == page.type | |
) { | |
alert(page.productId); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment