Announcement

Collapse
No announcement yet.

RRP yet again (Sorry)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RRP yet again (Sorry)

    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
    Jewellery247.co.uk
    AndrewBerry.com

    W: http://www.WelshGoldOnline.co.uk
    W: http://www.jewellery247.co.uk
    W: http://www.AndrewBerry.com

    #2
    Wrong vat rate?

    Comment


      #3
      It looks to me as if you're using VAT inclusive pricing (as opposed to 'show prices including VAT' where prices are entered ex vat and then VAT is added on again).

      So remove the line that says

      $rawprice = $rawprice * 1.175; // add in vat if showing VAT inc prices

      As this is adding VAT on top of your prices that already include VAT.

      This should then do the sum: £135 - £75 = £60

      whereas it was doing the sum: £135 - (£75 * 1.175) = £47

      Mike
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment


        #4
        The words....wood....trees.... spring to mind.

        You are both life savers, many thanks, again.

        Andrew
        Jewellery247.co.uk
        AndrewBerry.com

        W: http://www.WelshGoldOnline.co.uk
        W: http://www.jewellery247.co.uk
        W: http://www.AndrewBerry.com

        Comment

        Working...
        X