Last active
June 6, 2017 08:16
-
-
Save makfruit/6571884 to your computer and use it in GitHub Desktop.
An HTML/JS snippet for Ecwid to add a size chart link to the product details panel
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
<!-- | |
An HTML/JS snippet for Ecwid to add a size chart link to the product details panel | |
https://gist.github.com/makfruit/6571884/ | |
--> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<script> | |
Ecwid.OnPageLoaded.add(function(page) { | |
if (page.type == 'PRODUCT') { | |
if (jQuery("#size_chart_link").length == 0) { | |
jQuery("<a />", { | |
"id": "size_chart_link", | |
"text": "View Size Chart", | |
"target": "_top", | |
"href": "http://google.com", // put your sizechart URL here | |
"onclick": "window.open('http://google.com','Size Chart','width=400,height=200'); return false;" | |
}).insertAfter(".ecwid-productBrowser-details-optionsPanel"); | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment