Skip to content

Instantly share code, notes, and snippets.

@qetzal
Created August 26, 2011 10:06
Show Gist options
  • Save qetzal/1173126 to your computer and use it in GitHub Desktop.
Save qetzal/1173126 to your computer and use it in GitHub Desktop.
Redirecting links inside the popup //ecwid
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<div>
<script type="text/javascript" src="http://app.ecwid.com/script.js?661823" charset="utf-8">
</script>
<script>
var store_page = 'http://shop.designedmade.co.uk/test_page.html';
function is_ecwid_pb_popup() {
var retnode = [];
var cl = "ecwid-ProductBrowserPopup";
var myclass = new RegExp("\\b" + cl + "\\b");
var elem = document.getElementsByTagName('div');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) return true;
}
return false;
}
Ecwid.OnPageLoad.add(function(page) {
if ( (page.type == 'CATEGORY') && (is_ecwid_pb_popup()) ) {
document.location = store_page;
}
});
</script>
<script type="text/javascript"> xMinicart("style=position: fixed; top: 0px; left: 200px; margin: 5px;"); </script>
<div class='ecwid-Product'>
<script type="text/javascript">xAddToBag('productid=6014774');</script></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment