Skip navigation

Currently Being Moderated

Hiding a retail price for items that are not on sale

Mar 26, 2012 5:03 PM

Add the following script to the large or small products layout for an online store:

 

<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> 

 

After adding this script, the retail price will be hidden for every item that is not currently on sale.

 
Comments (6)