Announcement

Collapse
No announcement yet.

Savings based on RRP not displaying correctly

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

    Savings based on RRP not displaying correctly

    I have modified a layout using Normans ‘Automatically Calculate Savings based on an RRP’ - AUG V9 (P71) with slight variations;

    ------------------------------------------------------------------------------------------------------------
    <actinic:block php="true">
    $rrp = <actinic:variable name="RRP" selectable="false" />;
    $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;

    // only display if we have an RRP and there's a saving to show
    if ( ($rrp != 0) && ($rrp > $rawprice) )
    {
    $savepercent = round((($rrp - $rawprice) / $rrp) * 100);
    echo "(RRP £$rrp - Save $savepercent%)";
    }
    </actinic:block>
    --------------------------------------------------------------------------------------------------------------
    I am having a problem with the displayed RRP price as follows;

    Entered in variable 20.99 – Displayed £20.99
    Entered in variable 20.90 – Displayed £20.9
    Entered in variable 20.00 – Displayed £20

    When you enter the RRP value for the product as 20.90 and then go back to it after applying it, the trailing 0 has been removed so I suspect it is a database setting.

    The variable has ‘Number’ selected and ‘Whole Numbers Only’ un-checked.

    Can anyone offer some advice?

    Thanks
    Colin
    Colin - www.MintingDigital.co.uk
    Web Design, Hosting and Sellerdeck since V8

    #2
    You could specify how many places to display for $rrp.

    see this: http://community.actinic.com/showpos...7&postcount=42

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

    First Tackle - Fly Fishing and Game Angling

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

    Comment


      #3
      Thanks for your reply.

      I have now tried this ;

      <actinic:block php="true">
      $rrp = round( <actinic:variable name="RRP" selectable="false" /> ,2);
      $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;

      // only display if we have an RRP and there's a saving to show
      if ( ($rrp != 0) && ($rrp > $rawprice) )
      {
      $savepercent = round((($rrp - $rawprice) / $rrp) * 100);
      echo "(RRP £$rrp - Save $savepercent%)";
      }
      </actinic:block>


      I am not sure if that is how it would be added as I am not familiar with PHP. This made no change.

      Colin
      Colin - www.MintingDigital.co.uk
      Web Design, Hosting and Sellerdeck since V8

      Comment


        #4
        {
        $amountsaved = ($rrp - $rawprice);
        $savepercent = ((($rrp - $rawprice) / $rrp) * 100);
        echo "RRP £$rrp - you save £$amountsaved";
        echo " (".number_format($savepercent,1);
        echo "%)";
        }

        Comment


          #5
          This, although calculates the amount and percentage saved, is still displaying without the final ‘0’ (i.e. £20.9)

          I am still wondering why when I look back at the RRP variable in the product it has also removed the final ‘0’ and if there might be a problem with the way the database saves it.
          Colin
          Colin - www.MintingDigital.co.uk
          Web Design, Hosting and Sellerdeck since V8

          Comment


            #6
            try this instead

            PHP Code:
            {
            $amountsaved = ($rrp $rawprice);
            $savepercent = ((($rrp $rawprice) / $rrp) * 100);
            echo 
            "RRP £"number_format($rrp,2), " - you save £"number_format($amountsaved,2);
            echo 
            " ("number_format($savepercent,2), "%)";

            "If my answers frighten you then you should cease asking scary questions"

            Comment


              #7
              No still not working!

              It is calculating correctly.
              Only the RRP value is missing the final ‘0’.
              Colin - www.MintingDigital.co.uk
              Web Design, Hosting and Sellerdeck since V8

              Comment


                #8
                Try the code again, i was a bit naughty and edit the post
                You might of got the old code - sorry
                "If my answers frighten you then you should cease asking scary questions"

                Comment


                  #9
                  Thanks to all,

                  This is now a working solution


                  Best wishes
                  Colin
                  Colin - www.MintingDigital.co.uk
                  Web Design, Hosting and Sellerdeck since V8

                  Comment


                    #10
                    how to get this to work with product duplicates

                    hi there, ive got this to work on the main products but when i add it to my duplicate layout it doesnt seem to work. It gives a dodgey number. Anyone come across this before?
                    www.onlineaquariumstore.com
                    www.onlinevivariumstore.com
                    www.onlinepondstore.com

                    Comment


                      #11
                      Yes, it's a bug with the extremely buggy duplicates feature in actinic. Duplicates have never worked properly and I've done plenty of moaning about it to Actinic. Please moan about it youself so it gets moved higer up the list of things to fix.

                      In this instance, it is ProductPriceRaw that is not updating at duplicates. You have to reset your duplicates to get the price to update when you change it at the Original product. A real ball-ache if you've changed the product name or description at the duplicates.

                      Other things to watch for not updating
                      • Image
                      • Thumbnail Image
                      • Pricing Model (if using components)
                      • Min/Max quantity orderable.

                      Comment


                        #12
                        Originally posted by bentleybloke View Post

                        In this instance, it is ProductPriceRaw that is not updating at duplicates. You have to reset your duplicates to get the price to update when you change it at the Original product. A real ball-ache if you've changed the product name or description at the duplicates.
                        Yep its a right ball ache when customers tell you the sums dont add up, i use spp's which are the main product and all is well if i make a price change, now i have to reset the duplicates every time which is a PITA when i use sage to import stocks and prices as i have to remember what i have changed in sage then find them in Actinic

                        Comment

                        Working...
                        X