Tag onsale

From Online Business Wiki

Jump to: navigation, search

{tag_onsale} - Renders 1 if product on sale, otherwise 0.

If page elements needs to be altered for products on sale, then embed tag in relevant JavaScript.

Hiding a retail price when product is on sale

When product is not on sale (which is when the tickbox "OnSale?" is not ticked in that product's description) it is sometimes useful to hide the RRP and display one price only. This can be achieved with a following script:

<script language="javascript"><!--

var onsale_{tag_productid} = "{tag_onsale}";

if (onsale_{tag_productid} == "0") {
 document.getElementById("rrpprice_{tag_productid}").style.display = 'none'; }

//--></script>

Then you would assign the following tag ID to a retail price tag:

<div id="rrpprice_{tag_productid}">{tag_retailprice}</div>
Support Material