Announcement

Collapse
No announcement yet.

V9 Product Level Special Offers

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

    V9 Product Level Special Offers

    Hi Guys, i'm working on a new deployment and really trying to push actinic to it's full capabilities. My product base is to be marked up just under RRP and the product prices are kept linked to an access table.

    Basically I want to show the product's RRP and then my price next to it, maybe detailing the saving made. I understand you can apply discounts through actinic at a product group level, but I want to be able to reduce the price on maybe a handful of unrelated products and have actinic treat it (or at least display it in the shop) in a similar manner to the 3for2 type deals.

    Is the best of way doing these product level discounts (as opposed to product group level) to use custom variables such as 'RRP' and 'OnOffer' and use those to display my pricing information & special offer lists or is there some functionality for this within actinic.

    Cheers, Rob
    Golf Grips Direct
    Hobby Tools

    #2
    You are best to add your own functionality into the product layout for this sort of stuff (plenty of previous threads provide the RRP and saving % code) and you just switch on the features via blockifs, so you have one product layout that does a variety of things, dependent on what you select. As long as you understand variables and blockifs, it's a very easy task. Don't forget costprice variable too, you can use that for other things if you want.

    Comment


      #3
      Thanks Lee, I had feeling that would be the case but didn't want to reinvent a feature that was already inherent, if i'm honest I'm more comfortable doing things with custom variables and lists but thought though there might be a 'best practice' method.

      Just ooc, does the costprice variable appear on the site or in actinic anywhere by default or is it just for reporting?

      I'm getting pretty adept at using lists (those stickied tutorials are awesome), I do have some questions though:
      Firstly, Is there an else statement in actinic like in php? How would I go about specifying every nth item in a list? I'd like to target every 4th item to override some styling.
      Code:
      (Listindex == 4) OR (Listindex == 8) OR etc.
      Could work but i'd prefer something a little more elegant.

      Code:
      [(Listindex / 4 == EVEN) OR (Listindex / 4 == ODD)]
      I thought I could use this to check for integers to see whether the current item is a multiple of 4, not sure if actinic blockifs likes arithmetic though.

      This is shorthand of what i'm trying to achieve
      Code:
      Block:entiresectionlist
          BlockIf:(showninthislist== true)
              BlockIf:(listindex !== multiple of 4)
                   Normal Styling
               Else
                   Alternative Styling
              /Blockif
          /BlockIf
      /Block
      Any pointers would be greatly appreciated
      Thanks, Rob
      Golf Grips Direct
      Hobby Tools

      Comment


        #4
        CostPrice is principally for reporting and not used by default in any layout, it has been made available to add to layouts though, if you want to, just add the variable.

        I'd suggest something like you need to use php instead by applying the listindex value to your own php variable and then process the data via actinic's inbuilt php.

        Alternatively, if the processing of 4 is only ever going to need to go to say 28 or so ie it will never exceed that sort of size, i'd just do a compunded OR statement like you have.

        If you use the blockif within the class name of the container eg

        class="MyClassBlockifblah/Blockif", you can then change css class on the fly according to your 4 way calc.

        Comment


          #5
          You can use PHP within blockif's. So to test if something is modulus 4, just use:

          (ListIndex % 4) == 0

          Or in longhand (ready to paste into the Condition editor):

          (<actinic:variable name="ListIndex" /> % 4) == 0

          You don't need any <actinic:block php="true">...</actinic:block> tags. Just the code above. Blockif's are inherently PHP true.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Thanks a bunch guys, I'll give it a go when I get home this evening
            Golf Grips Direct
            Hobby Tools

            Comment


              #7
              Originally posted by NormanRouxel View Post
              You can use PHP within blockif's. So to test if something is modulus 4, just use:

              (ListIndex % 4) == 0

              Or in longhand (ready to paste into the Condition editor):

              (<actinic:variable name="ListIndex" /> % 4) == 0

              You don't need any <actinic:block php="true">...</actinic:block> tags. Just the code above. Blockif's are inherently PHP true.
              That's a clever little bit of coding, didn't know you could do that.
              I take it % means modulus in php and returns 0 if it is and 1 if it isn't?

              That could be a very powerful tool on CSS layouts.

              Comment


                #8
                Not quite. $a % $b returns the remainder of $a divided by $b (or just $a if $a < $b).

                Operands of modulus are converted to integers (by stripping the decimal part) before processing.

                Also, remainder $a % $b is negative for negative $a.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  So it's saying if listindex divided by 4 = 0, so basically a 0 indicates a number divisible by 4 with no remainder, for any other number it would produce a 1,2 or 3 and thus fail on the condition?

                  Comment


                    #10
                    Currently working on a custom variable for RRP, having some difficulties with data types I think though. I want to use a block if for when the RRP is not equal to the price. Here's my block if:

                    Code:
                    <actinic:block if="%21%28%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22Price%22%20%2f%3e%29" >
                    	<p><actinic:variable name="RRP" /></p>
                    </actinic:block>
                    In other words if the RRP is not equal to the Price, show this text.

                    My RRP variable is a number data type being entered in pennies. The example i'm using has an RRP of 3995. I tried using a text data type but that doesn't seem to work either, how do I make a variable such that it can be compared to the price variable at product level?

                    Cheers guys, Rob
                    Golf Grips Direct
                    Hobby Tools

                    Comment


                      #11
                      Originally posted by GolfGripsDirect View Post
                      how do I make a variable such that it can be compared to the price variable at product level?
                      Turns out there's a little variable called <actinic:variable name="ProductPriceRaw" />
                      this works fine for 'greater than or equal to' like statements

                      The glorious blockif:
                      Code:
                      <actinic:block if="%21%28%3cactinic%3avariable%20name%3d%22ProductPriceRaw%22%20%2f%3e%20%20%3e%3d%20%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%29" >
                      
                      </actinic:block>
                      I'd like to show saving off the RRP aka $saving= ($RRP - $Price), any thoughts on how i'd do this?

                      Cheers, Rob
                      Golf Grips Direct
                      Hobby Tools

                      Comment


                        #12
                        Originally posted by GolfGripsDirect View Post
                        I'd like to show saving off the RRP aka $saving= ($RRP - $Price), any thoughts on how i'd do this?
                        I've tried to steer away from using php because I wanted to really learn when and where to use the inbuilt capabilities, but I found the following code and used changed it to make it more fitting for myself:
                        http://community.actinic.com/showthread.php?t=45412

                        Here's my blockif to show the saving based on an RRP number variable minus the price:
                        Code:
                        <actinic:block php="true" >
                        $rrp = <actinic:variable name="RRP" selectable="false" />;
                        $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
                        $saving = sprintf("%01.2f", ($rrp - $rawprice));
                        echo "£$saving";
                        </actinic:block>
                        Couple of little tweaks like my prices are entered including VAT and I use this just to echo the value handling all the styling on the layout, but most notably I've used the sprintf function to keep the trailing zeros for it to be in a currency like format.

                        Thought it might be useful to someone,
                        Rob
                        Golf Grips Direct
                        Hobby Tools

                        Comment


                          #13
                          Rob, do you have an example of this running on your site?

                          Maths is mostly a mystery to me, but I'm assuming that as your code uses ProductPriceRaw, it will also work with a vat-exclusive pricing model?
                          Kind Regards
                          Sean Williams

                          Calamander Ltd

                          Comment


                            #14
                            Be aware that if you use Duplicates, then ProductPriceRaw won't automatically update in the Duplicate if you later change it on the main product.

                            Details and a workaround on http://community.actinic.com/showthread.php?t=48156
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                              #15
                              Originally posted by Sean Williams View Post
                              Rob, do you have an example of this running on your site?

                              Maths is mostly a mystery to me, but I'm assuming that as your code uses ProductPriceRaw, it will also work with a vat-exclusive pricing model?
                              Hi Sean, I've added a line to the code to calculate the rawprice + 20% VAT for vat exclusive pricing. Please change it below if your VAT rate is different to 20%.
                              Code:
                              <actinic:block php="true" >
                              $rrp = <actinic:variable name="RRP" selectable="false" />;
                              $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
                              // This line adds 20% VAT to rawprice
                              $rawprice = $rawprice * 1.2;
                              $saving = sprintf("%01.2f", ($rrp - $rawprice));
                              echo "£$saving";
                              </actinic:block>
                              I'd link my development site but it's hidden from search engines at the moment and i'd rather not start posting links to the development directory for search engines to spider.

                              Again this is based on a custom variable called RRP (type set to number, whole numbers only unchecked) and it echos a plain unformatted number for how much is saved. Wrap the code in your <p> tags or whatever you want to use for styling.

                              Thanks for that useful tidbit and the workaround Norman, i'm avoiding using duplicates as much as possible, making use of custom lists to create a multifaceted navigation hierarchy but it's good to know.

                              Cheers, Rob
                              Golf Grips Direct
                              Hobby Tools

                              Comment

                              Working...
                              X