Announcement

Collapse
No announcement yet.

Help Adding a RRP Comparison

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

    Help Adding a RRP Comparison

    Hi all,

    I currently use a piece of code in some of my item descriptions to compare the sale price of a product to an RRP (a variable i've set up)

    The code i use is:

    <actinic:block php="true" selectable="false">
    $rrp = [RRP];
    $rawprice = [ProductPriceRaw];
    $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) )
    {
    $savepercent = round((($rrp - $rawprice) / $rrp) * 100);
    echo "RRP £$rrp - you save $savepercent%";
    }
    </actinic:block>

    What i want to do, is to have this for each product but not in my description box.
    When i try putting it in within the design section to a layout code it tells me i have a parce error. What am i doing wrong, or is this not possible?

    Thanks for your help in advance
    Graeme

    #2
    It should be fine if you are adding it to the product layout in the design. Where are you trying to add it?

    Comment


      #3
      Yes its the product layout in the design. I've attached a screen shot from within the design tab, and you can see the parse error on screen
      Attached Files

      Comment


        #4
        Oh, yes and just to note that the RRP comparison that you can see working in my above screenshot is done in the item description

        Comment


          #5
          In the description? you want it in the product layout surely, not the description.

          Comment


            #6
            Originally posted by leehack View Post
            In the description? you want it in the product layout surely, not the description.
            Yes that is what i am trying to do... At the moment it works by manually putting it in a product description field as shown in the screen shot.

            Comment


              #7
              Sounds like you are not in your product layout when adding it or you are adding it in the middle of other code in the product layout. You might find it easier to open the product layout from the design library if the design tab is a little confusing.

              Comment


                #8
                Originally posted by leehack View Post
                Sounds like you are not in your product layout when adding it or you are adding it in the middle of other code in the product layout. You might find it easier to open the product layout from the design library if the design tab is a little confusing.
                I don't think this is the case.
                I'm definately in the code for the product layout, and am inserting the code outside of other code blocks. I can even move the parse error around product layout to appear above or below the pice etc.

                Comment


                  #9
                  Hmm ok sounds like you know what you're talking about, are the actinic variables in the php showing up as blue underlined links as they don't look the correct format to me. Perhaps you are not using actinic variables and using pseudo ones in square brackets?

                  Comment


                    #10
                    Have managed to sort it. It wasn't recognising my variable names

                    Comment

                    Working...
                    X