I know this has been discussed many times before but I can not get it right.
Its about RRP and You Saved etc.
This is the code I have placed in the layout
<actinic:block php="true">
$rrp = <actinic:variable name="RRP" selectable="false" />;
$rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
$rawprice = $rawprice * 1.175; // add in vat if showing VAT inc prices
// only display is we have an RRP and there's a saving to show
if ( ($rrp != 0) && ($rrp > $rawprice) )
{
$amountsaved = round($rrp - $rawprice);
$savepercent = round((($rrp - $rawprice) / $rrp) * 100);
echo "RRP £$rrp - you save £$amountsaved ($savepercent%)";
}
</actinic:block>
But the % and savings do not add up. See here http://www.ziplob.co.uk/store/D-Section_Yellow.html (Only a test site)
The VAT is set as Prices including VAT.
Can any one enlighten me please as to why the % does not add up and the amount saved should be £60.
Andrew
Its about RRP and You Saved etc.
This is the code I have placed in the layout
<actinic:block php="true">
$rrp = <actinic:variable name="RRP" selectable="false" />;
$rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
$rawprice = $rawprice * 1.175; // add in vat if showing VAT inc prices
// only display is we have an RRP and there's a saving to show
if ( ($rrp != 0) && ($rrp > $rawprice) )
{
$amountsaved = round($rrp - $rawprice);
$savepercent = round((($rrp - $rawprice) / $rrp) * 100);
echo "RRP £$rrp - you save £$amountsaved ($savepercent%)";
}
</actinic:block>
But the % and savings do not add up. See here http://www.ziplob.co.uk/store/D-Section_Yellow.html (Only a test site)
The VAT is set as Prices including VAT.
Can any one enlighten me please as to why the % does not add up and the amount saved should be £60.
Andrew
Comment