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

mikeboon

  • Beginner
  • *
  • Posts: 33
    • Kinderenkoning
How to show all products in my category at once
« on: March 07, 2010, 17:44:34 pm »
Hello all,
I’ve been reading all over the place but can’t find a solution.

In my shop I’ve maximum 40 articles per categorie so I prefer to show "all" articles at once (example page http://www.kinderenkoning.be/index.php?/Loopfietsen/View-all-products.html) (now only 25 products are shown and the pagination is not working as it should be, plus a second page give me an extra complexity to set the title/description okay via SEH404 for SEO reasons).

Or if I can set the 25 (default) to 50 somewhere it would also help me out.

Simple question but how do I achieve this? I searched more than an hour on Google and the forum but no decent answers.
Mike

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28461
  • Always on vacation
    • Jenkin Hill Internet
Re: How to show all products in my category at once
« Reply #1 on: March 07, 2010, 19:08:26 pm »
This is set by List Length in Joomla's configuration. Maximum is 100 but you should be able to make that figure bigger. See http://forum.joomla.org/viewtopic.php?f=178&t=452317
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30

mikeboon

  • Beginner
  • *
  • Posts: 33
    • Kinderenkoning
Re: How to show all products in my category at once
« Reply #2 on: March 13, 2010, 21:40:43 pm »
Thanks for your reply but I do not understand the post on the other forum :-/

What I want is no tlistbox (5, 10, 15, 20, ...) at all. I just want to visualize ALL my poducts with pagination at all and no listboxes on the top or bottom.

Is this feasible?

THANKS again

mikeboon

  • Beginner
  • *
  • Posts: 33
    • Kinderenkoning
Re: How to show all products in my category at once
« Reply #3 on: March 13, 2010, 21:50:57 pm »
FYI: The post you are referrign to is also referrign to Joomla, but not to VirtueMart.

The strange thing is that in one category there are only shown 5 products at a time, and in other category 20 products at a time. So not equal for each category.
Very very strange :-/

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28461
  • Always on vacation
    • Jenkin Hill Internet
Re: How to show all products in my category at once
« Reply #4 on: March 13, 2010, 23:28:49 pm »
The list length is set in Joomla, as above. To remove start/prev/end see http://forum.virtuemart.net/index.php?topic=50249.0
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #5 on: July 13, 2010, 12:27:39 pm »
Hi Jenkinhill

Is there a way to include a hyperlink to 'Show All' products in a category (*or* sub-category but not both, if you see what I mean - ie, I don't want the 'Show All' functionality to 'cascade' through all of a category's sub-categories, but only show the products within that category or sub-category).

Ideally I would like to display the link to the right of the 'Display #' listbox at the top of a product category's browse page? My client wants a text link or button so her clients can't miss the option (ie, if it was 'hidden' in the Display # listbox)

The site is using VM 1.1.4 and J1.5.15

Many thanks in advance

Christopher
There are 10 types of people in the world:
Those who understand binary and those who don't

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28461
  • Always on vacation
    • Jenkin Hill Internet
Re: How to show all products in my category at once
« Reply #6 on: July 13, 2010, 13:05:26 pm »
I don't know a way to do that, but I can't see why it should not be possible with a bit of programming.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #7 on: July 13, 2010, 13:20:05 pm »
Hi Kelvyn

Yes - I figured that, but I've got enough php/J!/vm knowledge to be dangerous, so thought I'd ask here first.

Please could you give me some pointers, before I risk wrecking a stable shop?

Even changing the 'Display #' listbox to include a 'Show All' option is looking attractive rather than hacking the site at this late stage.

I promise I'll buy you lots and lots of ale the next time I'm in Keswick to go climbing!

Many thanks

Christopher
There are 10 types of people in the world:
Those who understand binary and those who don't

dreamyguy

  • Beginner
  • *
  • Posts: 13
Re: How to show all products in my category at once
« Reply #8 on: July 27, 2010, 16:17:38 pm »
The list length is set in Joomla, as above. To remove start/prev/end see http://forum.virtuemart.net/index.php?topic=50249.0

I must be missing something here, because if it's Joomla setting these choices then the choice "100" should have been there in Virtuemart as well. I've changed the "application.php" file on the same location referred to on the post you indicated, adding 200, 1000 and 5000. These options show and are selectable in Joomla administration, but are not in Virtuemart.

In virtuemart, this line:

$html .= '<td>' .$this->getLimitBox() . '</td>';

...is the one that calls the drop-down list, but I wonder where it's coming from!

Has anyone stumbled all the way into this, meaning, anyone really tried to get more options showing in the drop-down list at the bottom of Virtuemart's product list?

Cheers,
Wallace

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #9 on: July 27, 2010, 16:28:37 pm »
The only solution I've found (which luckily my customer was happy with) can be found here:

http://forum.virtuemart.net/index.php?topic=73356.0

I hope that helps

Cheers

Christopher
There are 10 types of people in the world:
Those who understand binary and those who don't

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #10 on: July 27, 2010, 16:37:25 pm »
Quote
Has anyone stumbled all the way into this, meaning, anyone really tried to get more options showing in the drop-down list at the bottom of Virtuemart's product list?

Sorry - I've just fully re-read your post - Yes, you can do that bit by editing the code around line 58 - 68 in the following file:

administrator/components/com_virtuemart/classes/pageNavigation.class.php

... For example, I changed mine to increase in multiples of 9, so with three products per row and a minimum of nine products displayed, a nice 3 x 3 grid of products is always displayed.

You can increase the maximum number listed on line 68

Hope that helps

Christopher
There are 10 types of people in the world:
Those who understand binary and those who don't

dreamyguy

  • Beginner
  • *
  • Posts: 13
Re: How to show all products in my category at once
« Reply #11 on: July 28, 2010, 09:16:56 am »
Hi Christopher,

It really helped to change those lines! Below is the screenshot of the result.



On line 59-59 I set the total to 100 (previously 30) and the multiplier to 20 (previously 5). On line 67-68 I changed the limit to 500 (previously 50). It's perfect!

That proves that the solution proposed by Jenkin (stating that this is set by Joomla's list length) is wrong. It is all on the file you've mentioned:

administrator/components/com_virtuemart/classes/pageNavigation.class.php

This is the first solution to a problem I've asked directly on this forum... many thanks!

Cheers,
Wallace

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #12 on: July 28, 2010, 09:43:25 am »
No problem - I didn't solve the issue, just found the answer after several days trawling the forum.

I think we need a 'Meta Forum' of solved issues, properly categorised - this forum is good but bloated with posts from people asking the same questions because they're unable to find answers/solutions quickly.

By the way, if you work out a way to put "Show All" in the list box as a final option, please let me know - my other post (above) details how to replace the "Display #" listbox with links marked "Show All / Show Less".

Cheers

Christopher
There are 10 types of people in the world:
Those who understand binary and those who don't

lbpdk

  • Guest
Re: How to show all products in my category at once
« Reply #13 on: August 05, 2010, 18:07:44 pm »
Hi Christopher and dreamyguy

Your statements are not completely correct. Jenkinhill has got something right, when he states that the Joomla list length is used, because when you go to a list for the first time, the Joomla list length is used for the initial display.
But the values presented in the limitbox are taken from the entries in the "Navigation.class.php" file. Unfortunately the default value of that is "5", very annoying if the Joomla list length is set to 100.
I have tried to follow the instructions from dreamyguy on how to change the Virtuemart values, but need a little more guidance.

Line 59-70 says:
    for ($i=5; $i <= 30; $i+=5) {
      if (empty( $link)) {
        $limits[$i] = $i;
      } else {
        $limits[vmRoute($link.'&limit='.$i)] = $i;
      }
    }
    if (empty( $link)) {
      $limits[50] = 50;
    } else {
      $limits[vmRoute($link.'&limit=50')] = 50;
    }

How may of the "50"'s do you change? All 4?

Still it seems that the default value of 5 will follow you forever? Because of the first $i=5. Is that correct?

Is there anyway to use the value from Joomla list length as the default value for Virtuemart?

Best regards
Lars

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: How to show all products in my category at once
« Reply #14 on: August 06, 2010, 09:57:13 am »
Quote
How may of the "50"'s do you change? All 4?

Hi Lars

In a nutshell, yes - here is the code from my version of the file where I wanted the maximum number of products displayed on a screen to be 9, the options in the listbox to be 9,18,27,36 and 45 (Hence the '45' in the first line) and the maximum (final or 'limit') option available in the listbox to be 90:

Code: [Select]
for ($i=9; $i <= 45; $i+=9) {
      if (empty( $link)) {
        $limits[$i] = $i;
      } else {
        $limits[vmRoute($link.'&limit='.$i)] = $i;
      }
    }
    if (empty( $link)) {
      $limits[90] = 90;
    } else {
      $limits[vmRoute($link.'&limit=90')] = 90;
    }

So with the code you have quoted, the listbox would have the values:

5
10
15
20
25
30
50

i.e. The first line says "The default number of products to display is 5 ( $i=5; ) and this should go up in steps until it reaches a value of 30 ( <= 30; ) and the increment should be 5 ( $i+=5 ). The final line says "Once you've displayed the options defined in the first line, display a maximum, or upper, option of 50.

Therefore it is important to make sure that the value of this bit of code "$i+=5"
 ...will divide into both the lower and upper values without leaving a remainder - for example, using a value of $i+=7 would not work

[If anyone thinks I've got something wrong in the description/explanation above, please let me know - I'm not an expert!!]

I hope that helps

Cheers

Christopher
There are 10 types of people in the world:
Those who understand binary and those who don't