I am trying to set up Global Cross Sell on a product template page. So far under Merchandising > Cross Sell, I turned on Global Cross Sell, assigned 12 items to it and assigned 'random' to how it will display.
On the template i have this so far:
[-- DEFINE GLOBAL_CROSS_SELL --]
<tr>
<td>
<img src="../media/[-- IMAGE Product.MoreInformationGraphic --]" height="100px" />
<br />
[-- IF Product.DisplayMoreInformationPage --]
<a href="[-- Product.MoreInfoURL --]"><strong>[-- Product.Name --]</strong></a>
[-- ELSE --]
<strong>[-- Product.Name --]</strong>
[-- END_IF --]
<br />
[-- Product.SKU --]
<br /><br />
[-- IF PRODUCT.SaleOn --]
<span class="fl-priceslash">[-- PRODUCT.Price --]</span><br />
<span class="fl-saleprice">[-- PRODUCT.SaleAmount --]</span>
[-- ELSE --]
<span class="fl-price">[-- PRODUCT.Price --]</span>
[-- END_IF --]
<br />
<input type="checkbox" name="itemnum" value="[-- Product.RecordNumber --]" id="[-- Product.RecordNumber --]" class="checkboxQuantity">
<input type="text" name="[-- Product.RecordNumber --]:qnty" onkeyup="javascript: document.getElementById('[-- Product.RecordNumber --]').checked=(this.value!='')?true:false" class="inputQuantity">
<input type="image" value="submit" src="/graphics/addtocart.gif" alt="Add to Cart" />
<br /><br /><br />
</td>
</tr>
[-- END_DEFINE GLOBAL_CROSS_SELL --]
And then I have:
[-- IF Product.CrossSell 0 --]
<table>
<caption>[-- STORE.GlobalCrossSellHeader --]</caption>
[-- LOOP GLOBAL_Cross_Sell --]
[-- GLOBAL_CROSS_SELL --]
[-- END_LOOP Global_Cross_Sell --]
</table>
[-- ELSE --]
<script language="javascript" type="text/javascript">
function checkQuantity() {
var order = document.getElementById('orderingTable').getElementsByTagName('input')
var validate = false;
for ( i = 0; i < order.length; i++ ) {
if ( order[i].checked == true ) {
validate = true;
break;
}
}
if ( validate == false ) {
alert("You must enter a quantity for at least one item.");
}
return validate;
}
</script>
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post" onSubmit="return checkQuantity()">
<input type="hidden" name="storeid" value="[-- STORE_ID --]">
<input type="hidden" name="dbname" value="products">
<input type="hidden" name="function" value="add">
<table border="0" cellpadding="5" cellspacing="0" id="orderingTable">
[-- LOOP PRODUCT_CROSS_SELL --]
[-- PRODUCT_CROSS_SELL --]
[-- END_LOOP PRODUCT_CROSS_SELL --]
</table>
</form>
</div>
[-- END_IF --]
The Product Cross Sell works.
I am trying to get this to work on this page http://www.bakersgas.com/safety/EDG-XB.html