With Norman's keen eye and input the solution should be
In your Primary template your stock level javascript function should be
In your product line template the code should read
For the above example you will need to create 2 Custom properties.
DELIVERYMESSAGE - this is a default delivery message that displays when out of stock AND no product specificdelivery message has been specified. (specified at "Design | Options" in site default)
PRODUCTDELIVERYMESSAGE - this is the product specific delivery message that displays when a product is out of stock. (specified for each product)
Please note Norman's point about "no quote characters in customvar value field" and ensure you have the "USE AS CUSTOMVAR" option checked for each customvar you create.
Hope this helps
In your Primary template your stock level javascript function should be
Code:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- function StockLevels(pItem,strMessage){ if (strMessage == '') strMessage = "CUSTOMVAR:DELIVERYMESSAGE"; if (pItem >= 1) { strIDs = 'Usually despatched next working day'; } else { strIDs = strMessage; } return strIDs; } //--> </script>
Code:
<script language="Javascript"> document.write(StockLevels(NETQUOTEVAR:STOCKLEVEL,"CUSTOMVAR:PRODUCTDELIVERYMESSAGE")) </script>
DELIVERYMESSAGE - this is a default delivery message that displays when out of stock AND no product specificdelivery message has been specified. (specified at "Design | Options" in site default)
PRODUCTDELIVERYMESSAGE - this is the product specific delivery message that displays when a product is out of stock. (specified for each product)
Please note Norman's point about "no quote characters in customvar value field" and ensure you have the "USE AS CUSTOMVAR" option checked for each customvar you create.
Hope this helps
Comment