Announcement

Collapse
No announcement yet.

Paginate the Product List page with numbers

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

    Paginate the Product List page with numbers

    I have searched the forum and can not find any information on paginating the PLST page with numbers. I have category pages set up but the client wants to have the PLST paginate with numbers. I don"t want to use a Search module. I just simply want to paginate the PLST page with numbers. Does anyone know how to do this or is there a module that will allow me to do this? Thanks

    #2
    Re: Paginate the Product List page with numbers

    I thought about putting this in the Emporium Plus Tool Kit but I keep coming back to the efficiency issue. Grabbing the total number of products would require an extra query to your database which could take a second or two if you have a lot of products. Also, it would not be accurate if you use availability groups or your products are hidden from view when the inventory is depleted. You have to know the total number before you can do the page numbering.
    Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
    Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
    Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
    Facebook http://www.facebook.com/EmporiumPlus
    Twitter http://twitter.com/emporiumplus

    Comment


      #3
      Re: Paginate the Product List page with numbers

      I understand what you are saying, but if it can be done with the same parameters in the category area, then couldn"t it be done just as efficienctly and with the same parameters in the product list area?

      Comment


        #4
        Re: Paginate the Product List page with numbers

        No. The category typically has a couple dozen products. Whereas the whole store could have 100,000. It has to query the whole database rather than a one category subset.
        Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
        Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
        Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
        Facebook http://www.facebook.com/EmporiumPlus
        Twitter http://twitter.com/emporiumplus

        Comment


          #5
          Re: Paginate the Product List page with numbers

          Yes, but the product list is already paginating using next and previous. Why can"t numbers be added instead or in addition to the previous and next? We are already conrolling how many products appear on the page.

          Comment


            #6
            Re: Paginate the Product List page with numbers

            Because the module would need to know how many of the page numbers are there in total to display on the PLST page - and for that it would need to calculate how many products you have in the store and have access to. If it was just the total number of products it could be easy - just pull the number from the storekey database, but since some products can be unavailable to certain visitors (in availability groups, out of stock, etc), you can't use the "total number of products" and divide it by say 20 (if you do 20 products per page). So for this to work the module would need to go through ALL products in the store, see if you are allowed to view them (check all availability groups), see if each product is in stock, and then come up with total product count, and finally split that up to create page numbers. On a small store that may be ok, but on a store with 100,000 or more products it can take a few seconds, or longer (on a slow server).

            Comment


              #7
              Re: Paginate the Product List page with numbers

              Originally posted by nburkha1 View Post
              Yes, but the product list is already paginating using next and previous. Why can"t numbers be added instead or in addition to the previous and next? We are already conrolling how many products appear on the page.
              To clarify - your store currently does all those checks for the X number of products you display per-page. To get the page numbers, it would need to repeat this for ALL products first, before displaying the first page at all. See how long it takes you to go page by page through your PLST now, without page numbers, that will give you an indication how long it would take it if you added page numbers to the system.

              Comment


                #8
                Re: Paginate the Product List page with numbers

                That is just telling it what is the next record (which is the next record in the database after the last one displayed). Not the first record on the next 50 or 500 pages. You have to know how many pages there are. For that you need to know the total count.
                Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                Facebook http://www.facebook.com/EmporiumPlus
                Twitter http://twitter.com/emporiumplus

                Comment


                  #9
                  Re: Paginate the Product List page with numbers

                  I put the plstpages function in the Emporium Plus Tool Kit. It does check for the availability group and inventory status of the products so that the count is accurate for each visitor. As discussed above, you probably would not use this function in a MivaSQL store with 100,000 products. But a moderate MivaSQL store like this one http://www.pinemporium.com/mm5/merch...&Store_Code=PE or a much larger MySQL store should run with reasonable overhead.

                  The Tool Kit which has dozens of functions can be licensed from http://www.emporiumplus.com/go/wcw/PROD/1AA/1AA00223
                  Last edited by wcw; 08-18-09, 01:43 PM.
                  Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                  Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                  Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                  Facebook http://www.facebook.com/EmporiumPlus
                  Twitter http://twitter.com/emporiumplus

                  Comment

                  Working...
                  X