Author Topic: How to show all products in my category at once  (Read 19418 times)

chandler78

  • Beginner
  • *
  • Posts: 26
Re: How to show all products in my category at once
« Reply #15 on: September 27, 2010, 02:58:27 am »
How about just showing all products within a category by default.  I don't want the pagination visible at all, so I got rid of it via the pagination.php file.  I want all products to be listed by default when a customer clicks on a category.  How can I do this?

Chad

chandler78

  • Beginner
  • *
  • Posts: 26
Re: How to show all products in my category at once
« Reply #16 on: September 27, 2010, 03:34:34 am »
What I mean is to have all products within a category to display on a single page and not have to go next to see the rest.  So, if I have 300 products within a category (let's say 'Rings'), I want all of those 300 rings to show up on the browse page.  I don't want it to list 20, 50 or even 200.. I want them all to be listed on that single page.


How about just showing all products within a category by default.  I don't want the pagination visible at all, so I got rid of it via the pagination.php file.  I want all products to be listed by default when a customer clicks on a category.  How can I do this?

Chad

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #17 on: September 27, 2010, 10:50:37 am »
Hi Chad

Yes - that could work for some customers. Mine wanted 9 products per page, with three products per row, creating a 3 x 3 grid.

The other problem is taking a thumbnail image as say, 10kb filesize, if you're displaying 300 products with their images you're looking at the customer waiting for almost 3Mb of image downloads aside of any graphics etc needed for the site's template.

My customer wanted her clients to be able to page through results or, via an explicit link, to allow her clients to view all products within a category. Remember - the customer is always right until proven to be skint!

Also, in terms of user friendliness, my Missus will happily browse scores of pages of jewellery and note that particular pieces she likes are on pages X, Y and Z - she can then go back to those pages and take another look perhaps more easily than whizzing up and down the same web page.

I'm sure your solution will come in handy for certain applications however.
There are 10 types of people in the world:
Those who understand binary and those who don't

ngenge

  • Beginner
  • *
  • Posts: 22
Re: How to show all products in my category at once
« Reply #18 on: June 06, 2011, 05:34:52 am »
Hi Christopher,

Inside administrator/components/com_virtuemart/classes/pageNavigation.class.php, I changed

    for ($i=150; $i <= 300; $i+=150) {
      if (empty( $link)) {
        $limits[$i] = $i;
      } else {
        $limits[vmRoute($link.'&limit='.$i)] = $i;
      }
    }
    if (empty( $link)) {
      $limits[450] = 450;
    } else {
      $limits[vmRoute($link.'&limit=450')] = 450;
    }

The maximum products I have is over 140. So, I like to happen 150 as default. But the page is still showing 20 items per page. I thought I need to do "Clear Recent History". But the result is still showing 20 items.Please see the attached file. That's what my page showing.
If anyone already solved to this issue, Please Help me !
Many Thanks !

** I have been solved this problem **
According to Christopher (http://forum.virtuemart.net/index.php?topic=68067.msg245987#msg245987), I can get the select list beside Display.

According to jenkinhill (http://forum.virtuemart.net/index.php?topic=68067.msg225106#msg225106), I can change how many items that i want to display.

Thanks jenkinhill & Christopher !  :D  :D  :D  :D



[attachment cleanup by admin]

nflmerch

  • Jr. Member
  • **
  • Posts: 114
Re: How to show all products in my category at once
« Reply #19 on: July 07, 2011, 23:53:40 pm »
I noticed that when you edit the Navigation.class.php it changes the limits for both the front end and the admin side.  I have thousands of products on my site and I wanted the administrators to be able to view up to 500 products at once,  but it would be a bad idea to do that on the front end as Christopher pointed out. 
I solved my problem by duplicating the vmPageNav class and functions, naming it slightly different, editing the limits to my liking, and using that function for admin only (and the original function with the original limits I left for front end.)

In Navigation.class.php, copy the entire class including all the functions, and paste it below the class before the php closing tag.  In the newly pasted class, change the class name to "class vmPageNav2" and also a few lines below that change the function name to "function vmPageNav2", and edit the limits to your liking as others have already shown in this thread.   Now in the admin pages product.product_inventory.php and/or product.product_list.php, change the line where it says     // Create the Page Navigation     to reflect "vmPageNav2".
Hope this helps someone in the future.

tnet

  • Beginner
  • *
  • Posts: 3
Re: How to show all products in my category at once
« Reply #20 on: October 12, 2011, 15:54:45 pm »
Hi, thanks very much.
Also you can then hide all the ugly navigation at all. But first it is probably better to higher the values as was described.

HIDE:
1.     Go to yoursite/administrator/components/com_virtuemart/html
2.    Open up the file > shop.browse.php
3.    Go to line 476 (almost the end of the file) and look for the following snippet

    if ( $num_rows > 1 ) {
     $browsepage_footer = $tpl->fetch( 'browse/includes/browse_pagenav.tpl.php' );
     $tpl->set( 'browsepage_footer', $browsepage_footer );
     } else {
     $tpl->set( 'browsepage_footer', '' );
     }

 4.   Comment out all the lines with '//'.
 5.  Save the file

If you want to show pagination only if the number of rows (or products) are more than say, 20 products... instead of commenting out, you can change the first line to the following...

if ( $num_rows > 20 ) {

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #21 on: October 12, 2011, 16:30:03 pm »
Nice one tnet - Like it
There are 10 types of people in the world:
Those who understand binary and those who don't

collapsed

  • Beginner
  • *
  • Posts: 6
Re: How to show all products in my category at once
« Reply #22 on: November 21, 2011, 12:50:54 pm »
In Navigation.class.php, copy the entire class including all the functions, and paste it below the class before the php closing tag.  In the newly pasted class, change the class name to "class vmPageNav2" and also a few lines below that change the function name to "function vmPageNav2", and edit the limits to your liking as others have already shown in this thread.   Now in the admin pages product.product_inventory.php and/or product.product_list.php, change the line where it says     // Create the Page Navigation     to reflect "vmPageNav2".
Hope this helps someone in the future.
Good job. Thank you very much, it worked for me.