Announcement

Collapse
No announcement yet.

Savings based on rrp

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

    Savings based on rrp

    EDIT**************************************

    Recently I have used the advanced guide to add savings based on rrp to my site, the following is what i followed.


    Automatically Calculate Savings based on an RRP

    This technique will calculate a saving on prices based on the value of 'RRP' – a custom variable that you will need to create.

    It will display as follows within your product layouts.

    RRP: £10.00 – you save 8% To do this:
    1. Create a new variable called 'RRP' based on the instructions in the main help:
    'Understanding Variables > Adding a New Variable'. It needs to have a type of 'Number' rather than 'Text'.

    2. Enter some RRP values for your products. Remember to NOT include a currency symbol.

    3. Copy and paste the following code into your product layout(s) wherever you want the price saving message to appear.


    <actinic:block php="true">

    $rrp = <actinic:variable name="RRP" selectable="false" />;

    $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;

    $rawprice = $rawprice * 1.2; // 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) )
    {

    $savepercent = round((($rrp - $rawprice) / $rrp) * 100);

    echo "RRP £$rrp - you save $savepercent%";

    }

    </actinic:block>
    4. Apply changes and check the results in the preview. There are several areas where you can tweak this code.
    o Use a currency other than pounds by amending the '£' just before where it says '£$rrp'

    o If you use a tax rate other than VAT at 20% then you can amend the line that talks about
    'add in vat if showing VAT inc. prices'. If you don't charge tax at all you can safely delete
    this line.



    I added the new variable Named : RRP, Description: Retail Price and Promt of: Real Retail Price Cost.
    Group : product, place of setting site + product,
    Deselected allow use parent as an option
    Panel Name: Prices
    Type: Number
    Also i have ticked whole numbers only? I have tryed to untick this and still get the following error.


    The price Is £12.75, but it shows RRP 1500£ and a saving of 99%


    Although the excel sheet i use for my import shows, Price:1275 RRP 1500.

    All my prices have imported in correctly, with the correct decimal place (12.75), but the RRP doesn't get a decimal place in?



    Any help much appreciated, hope this is alot more clearer.

    #2
    Your vague posts are probably discouraging people from trying to help. I looked at your prior threads when you posted them and gave up because you won't express yourself clearly and unambiguously.

    E.g: implemented this. What is "this" and how did you "implement" it? Code snippets or a link to an article showing the code would help.

    Then: why the rrp doesnt seperate itself. What does "seperate itself" mean?

    And: everything was right in excel sheet. Perhaps it isn't. How do we know or not, if you don't post a sample of said spreadsheet.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Originally posted by STSO-UK View Post
      The price Is £12.75, but it shows RRP 1500£ and a saving of 99%

      Although the excel sheet i use for my import shows, Price:1275 RRP 1500.

      All my prices have imported in correctly, with the correct decimal place (12.75), but the RRP doesn't get a decimal place in?.
      SellerDeck (Actinic) works in pence internally so the spreadsheet values are imported directly into the database i.e. 1275 and 1500. The software converts the price to £12.75 for use in the software, but this only works for Actinic defined variables, you will have to deal with differences between RRP in pence and the selling price in £ for both display and in the PHP code for calculating the % saving

      Malcolm

      SellerDeck Accredited Partner,
      SellerDeck 2016 Extensions, and
      Custom Packages

      Comment


        #4
        Yay! You've edited your first post so it now makes sense.

        If you want to continue importing the RRP in pence then change the line:
        Code:
        $rrp = <actinic:variable name="RRP" selectable="false" />;
        to
        Code:
        $rrp = <actinic:variable name="RRP" selectable="false" /> / 100;
        Note that when posting snippets of code, best put them between [c o d e] and [/ c o d e] tags (type them without the spaces) as this makes them easier to read and preserves indentation.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Originally posted by NormanRouxel View Post
          Yay! You've edited your first post so it now makes sense.

          If you want to continue importing the RRP in pence then change the line:
          Code:
          $rrp = <actinic:variable name="RRP" selectable="false" />;
          to
          Code:
          $rrp = <actinic:variable name="RRP" selectable="false" /> / 100;
          Note that when posting snippets of code, best put them between [c o d e] and [/ c o d e] tags (type them without the spaces) as this makes them easier to read and preserves indentation.
          Tried this, it gave me an rrp of £15

          It didnt show £15.00 and the saving is now saying -2% rather than 15%

          Any ideas?

          Comment


            #6
            You said:
            Although the excel sheet i use for my import shows, Price:1275 RRP 1500.
            £12.75 + VAT is £15.30 and the RRP is £15.00, so there won't be a discount to show. So the code is working as intended.

            Since, you've not provided a link or said whether you enter / display prices including VAT or not so it's hard to help.

            Note that there's a line in the patch that adds in VAT to the raw product price. Delete it and see if that helps.

            It would also help if you can post the code you're using between code tags (as mentioned above), as the messy way you've pasted it in doesn't show it well.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Originally posted by NormanRouxel View Post
              You said:

              £12.75 + VAT is £15.30 and the RRP is £15.00, so there won't be a discount to show. So the code is working as intended.

              Since, you've not provided a link or said whether you enter / display prices including VAT or not so it's hard to help.

              Note that there's a line in the patch that adds in VAT to the raw product price. Delete it and see if that helps.

              It would also help if you can post the code you're using between code tags (as mentioned above), as the messy way you've pasted it in doesn't show it well.
              Yeah thats done it! Took the VAT code out and now its showing 15%, thanks for the help, appreciate it.

              Comment


                #8
                The code you posted in post #1 still seems wrong. You probably now have:
                Code:
                <actinic:block php="true">
                	$rrp = <actinic:variable name="RRP" selectable="false" /> / 100;
                	$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 - you save $savepercent%";
                		}
                </actinic:block>
                And you need:
                Code:
                <actinic:block php="true">
                	$rrp = <actinic:variable name="RRP" selectable="false" /> / 100;
                	$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 - you save $savepercent%";
                		}
                </actinic:block>
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Interesting route around the issue

                  we created an RRP as you do because we like to display that ourprice and amount saved. we just take the variable put them straight in and then simply minus ourprice from rrp for saving - its a much simpler way of doing it as we dont have % difference

                  also we use the inbuilt tax mechanism so there is no multiply by 1.2 taking out another step.

                  the more steps on a page like that the longer it takes to build, for us with around 1000 products we take out as many steps as possible in the build time. We dont like waiting 30mins for an upload
                  Adventure Centre Ltd - CheapTents.com

                  Comment


                    #10
                    Code like the above runs in under a millisecond so there's nothing to worry about.

                    If you want to check, add code like this around your stuff:
                    Code:
                    <actinic:block php="true">$time_start = microtime(true);</actinic:block>
                    
                    CODE YOU WANT TO TIME
                    
                    <actinic:block php="true">
                    	$time_end = microtime(true);
                    	echo "<br />Took " . ($time_end - $time_start) * 1000 .  " milliseconds<br />";
                    </actinic:block>
                    When I tried this on the above RRP code, it took 0.2 milliseconds, so I think you could stand the quarter second impact on a 1000 product site.

                    For interest, I tried timing the processing of the entire Product Page layout for the demo site Widescreen Multimedia PC as this has 3 sets of Components / Attributes / Associated Products and the total time elapsed was 17 milliseconds.

                    Tested on a 2 1/2 year old core i5 3.4 Ghz.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment

                    Working...
                    X