Hi I've been looking into implementing a strike through on our sca site and have been following article 61048 to do this however the current code below compares a custom price level against the online price and creates a strike through on the custom price level if its high than the online price level. all works great but not the way i would like it to function.
i would like to use the custom price as the sales price and then compare this against the current customer price level.
then create a strike through on the current customer price level if its high than the custom price level.
Is it possible to adjust this code to do this?
Thanks for any help in advance
code from article below:
_comparePriceAgainst: function (item){
var prices = item.get('_priceDetails');
var strikePrice = item.get('customPriceLevel');
if (prices)
{
if (prices.priceschedule)
{
return prices.priceschedule[0].price;
}
else if(Boolean(strikePrice))
{
console.log('pricesStrikeer',strikePrice);
return strikePrice;
}
else{
return prices.onlinecustomerprice;
}
}
else
{
return item.get('pricelevel1');
}
}
_comparePriceAgainstFormated: function (item)
{
var prices = item.get('_priceDetails');
var strikePriceFormatted = item.get('customPriceLevel_formatted');
if (prices)
{
if (prices.priceschedule)
{
return prices.priceschedule[0].price_formatted;
}
else if(Boolean(strikePriceFormatted))
{
return strikePriceFormatted;
}
else
{
return prices.onlinecustomerprice_formatted;
}
}
else
{
return item.get('pricelevel1_formatted');
}
}