Announcement

Collapse
No announcement yet.

Displaying only X amount of products in section / Ext Info

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

    Displaying only X amount of products in section / Ext Info

    Having managed to display the current section listing of products at the bottom of each Extended info page, I have realised that some sections are too large to be rendered into each Extended Info page as there are over 4,000 of them. At 100-200KB per HTML file for larger sections, this is obviously far too much. Reducing the number of products per section is not an option for SEO purposes due to the nature of the site and products.

    What I'd like to do is trim the list so it only displays a maximum of X products (e.g. 20 products) from that section. The first X products from each section would be sufficient, although a very nice touch would be to randomise them and create a genuine "sample" of other products from that section.

    It is important we do this, as a huge percentage of our customers land directly onto the Extended Info page of a specific item without being able to see instantly what other items our site has to offer.

    Any help would be greatly appreciated.

    Matt

    #2
    Have a look into the 'listcount' variable, add it to the layout and you should see see how each item gets numbered. You could then use a parameter saying listcount should not be over x amount via a blockif. The random presenter is a pipe dream though i expect. You could of course use related products instead. You could even create your own product level variable where you select yes or no as to whether it is to show in the list and once again filter the product list according to that.

    Another way is to scrap using extended info pages altogether, they're junk and good for nothing but larger images IMO. Use SPP setup instead.

    Comment


      #3
      Lee's right but it's the ListIndex variable that you need to use. ListCount is the total number of items in a list.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Thanks Lee. I've tried using the ListCount variable but unfortunately each product in the same section has the same value. Products in different sections have different values, but all the same as the other products in their section.

        I'm confused as to how to use a blockif when all the values are the same. Also, the values do not correspond to the total number of products in the section. I've attached a screenshot of part of a seciton. As you can see, the returned value is 44 for every product in that section.

        Am I missing something?

        Matt
        Attached Files

        Comment


          #5
          Just clashed posts there. Thanks Norman, I'll try it out.

          Matt

          Comment


            #6
            Excellent! Works perfectly. A simple blockif with ListIndex <= 20.

            Thanks again!

            Comment


              #7
              DOh, sorry for the curve ball Matt.

              Comment


                #8
                If you wanted to display a random sample you could use Actinics built-in PHP to do this.

                Something like (pseudo code):

                if (ListCount <= 20) use all products - done.

                Otherwise

                Generate 20 random integers between 1 and ListCount, store in an array ProdsToShow.

                Loop through all products - if (ListIndex in ProdsToShow) display product.

                Note that this would generate a different list every time you Update your site so there could be many pages needing to be uploaded.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment

                Working...
                X