Announcement

Collapse
No announcement yet.

Price Break Grid Display

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

    Price Break Grid Display

    I have read through many of the threads related to quantity based discounts (price breaks) but cannot find an answer to my question which is:

    I have product which has price breaks (1+, 3+ and 6+ items) and have used a BlockIf containing
    Code:
    <actinic:variable name="ListIndex" /> == 1
    so that only the first price is displayed as described in an old thread by Norman.
    I also have a grid/table displaying all the price breaks underneath, which can be seen here: Golf Club Cleaning Brush or in the attached image.
    The price break grid is separate to the one line price and can be positioned anywhere in the product layout.

    This works fine for products using a price break, but also displays a price break grid for all products.

    Is there an existing variable I could use in a BlockIf so I only display the price break grid layout when price breaks are used. I could always create a custom variable that I would need to set to true or false for each product but was hoping I could use an existing variable.

    The only related variables I could find were QuantityDescMin and QuantityDescMax, neither of which I could use to achieve my aim.
    Attached Files
    Darren Guppy
    Golf Tee Warehouse
    Golf Tees and Golf Accessories.

    #2
    Price breaks only show if you define some, otherwise things are just normal.

    For instance this http://www.thefittingscompany.co.uk/...ker_Waste.html is the exact same layout as this http://www.thefittingscompany.co.uk/...ad_Valves.html

    The price breaks only show on the one as that has some defined. I suspect your blockif is playing up or not doing what you think it is.

    Comment


      #3
      Lee,

      The Blockifs' are still working correctly but because I have two separate pricing layouts within the same product layout I only want the second pricing layout to display when price breaks exist.

      Sorry if it is not clear it is not simple to explain clearly.


      I have attached another image that shows what is displayed when no price breaks exist, which like you have stated does not display the price breaks only the one price, but as I have already displayed the price before I do not want it to display anything.


      At present I can move the price break grid anywhere within the product layout and leave the single price display where it is, but may need to merge the two back into a pricing single layout if that will make it easier.
      Attached Files
      Darren Guppy
      Golf Tee Warehouse
      Golf Tees and Golf Accessories.

      Comment


        #4
        A kludgy way might be to load your grid into a PHP variable, then interrogate said variable and only output it if there was more than one line.

        E.g.
        Code:
        <actinic:block php="true">
        $pricegrid = <<<ENDOFCODE
        <actinic:variable name="MyPriceGrid">
        ENDOFCODE;
        if ( strpos($pricegrid, '1+') )
          {
          echo $pricegrid;
          }
        </actinic:block>
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Ah with you now, you are going to need to replicate the price layout. Have the top one show all the time, this would not have the price breaks inside it, just a plain price as you always want that to show. Your second layout then needs to bring in the price breaks if there are any and do nothing if there are none. To get it to do none, you need to amalgamate all of the price break conditions into one big one and wrap the whole layout in that condition.

          I think you will need to do this split so that you get plain price above the price grid because of the way things are evaluated.

          Comment


            #6
            Thanks for the suggestions I will have a play around with the code.
            Darren Guppy
            Golf Tee Warehouse
            Golf Tees and Golf Accessories.

            Comment


              #7
              I seem to now have it working.

              The solution I have used is based on Lee's last suggestion, although I couldn't find a way to amalgamate all the price break conditions.

              I still have my two separate layouts (both of which are list layouts):
              Layout 1 - Single Line Price Layout
              Layout 2 - Price Grid Layout

              These two layouts are then inserted inside another list layout.

              Layout 1 is then surrounded by BlockIf containing:
              Code:
              <actinic:variable name="ListIndex" /> == 1
              and Layout 2 is surrounded by a BlockIf containing:
              Code:
              <actinic:variable name="ListIndex" /> == 2
              Therefore the first iteration through the list will display Layout 1 and not Layout 2, which will always occur whether price breaks are used or not.
              On the second iteration only Layout 2 will be displayed (this should only occur if price breaks are used.
              On further itertaions neither Layout will display.


              Hopefully no one will now come along and point out a major flaw in my theory
              Darren Guppy
              Golf Tee Warehouse
              Golf Tees and Golf Accessories.

              Comment


                #8
                Do you not need a >=2 in case you have 3 price breaks?


                Bikster
                SellerDeck Designs and Responsive Themes

                Comment


                  #9
                  I don't believe so as the BlockIf statement is in the outer list layout, so on the first iteration the "Single Line Price Layout" is shown, on the second iteration of the outer list the "Price Grid Layout" list is triggered which itself generates the multiple price break data.

                  If I added a >=2 I think I would get multiple price grids/tables.
                  Darren Guppy
                  Golf Tee Warehouse
                  Golf Tees and Golf Accessories.

                  Comment


                    #10
                    As a side question can anyone suggest a better way of getting the first line of price breaks to display as 1+ rather than (2 or fewer).

                    I tried adapting the existing variables and text but ended up with 0+ instead of 1+

                    I have a price break for 1-2, 3-5 and 6+ so want it to look like:
                    1+
                    3+
                    6+
                    The variables used are QuantityDescMin and QuantityDescMax

                    If I use QuantityDescMin+ for the first line I get 0+ and not 1+

                    To get around the minor problem, I added an extra price break with a minimum qty of 1 (see attached image for details) which solves the problem but ideally would like to avoid the extra stage of adding in an extra price break.

                    I guess there are other solutions involving PHP but would prefer to steer clear of that mysterious black magic (I may get around to learning PHP just in time for it to die out and be replaced by some new language).


                    Basically have I missed something obvious or done the the correct thing.
                    Attached Files
                    Darren Guppy
                    Golf Tee Warehouse
                    Golf Tees and Golf Accessories.

                    Comment


                      #11
                      Originally posted by Golf Tee Warehouse View Post
                      I don't believe so as the BlockIf statement is in the outer list layout, so on the first iteration the "Single Line Price Layout" is shown, on the second iteration of the outer list the "Price Grid Layout" list is triggered which itself generates the multiple price break data.

                      If I added a >=2 I think I would get multiple price grids/tables.
                      I see - you have nested 2 lists into another list


                      Bikster
                      SellerDeck Designs and Responsive Themes

                      Comment


                        #12
                        Is a nested list likely to cause any problems.
                        I can see that you wouldn't want to do this for long lists but as the price breaks are usually going to be upto 3 lines long and the number of products is under 100 I assumed it would be OK.

                        I can see that on a large site and with a list containing over 15-20 items then processing time would become an issue.
                        Darren Guppy
                        Golf Tee Warehouse
                        Golf Tees and Golf Accessories.

                        Comment


                          #13
                          I shouldn't think it would give you any real issues, it just seems a convoluted way of doing it that's all.


                          Bikster
                          SellerDeck Designs and Responsive Themes

                          Comment


                            #14
                            Following Jonts comments I decided to take another look and have now achieved the same result without nested lists.

                            The single price layout and the header of the price grid table are all within a ListIndex == 1 BlockIf with the rest of the code below and a </TABLE> tag in the "End of List" field of the list layout settings.

                            It now seems very simple although I managed to leave a couple of stray <tr> and </tr> tags in the "Middle Rows" field of the list layout settings without realising which had the effect of completely breaking the product layout and took a while to find.


                            I have probably wasted many hours trying to achieve this, although it could also be also looked at as many hours spent learning.
                            Darren Guppy
                            Golf Tee Warehouse
                            Golf Tees and Golf Accessories.

                            Comment


                              #15
                              Nice one. Best way to learn at times is to simply forget what has been done and think about it from a different angle. I have spent days attempting to get something to work and in a Eureka moment solved it with a much more simple and elegant solution that the original direction.


                              Bikster
                              SellerDeck Designs and Responsive Themes

                              Comment

                              Working...
                              X