Author Topic: Pagenav - set the number of products per page up to 5 pieces as default (not 20)  (Read 42952 times)

img

  • Beginner
  • *
  • Posts: 15
Hi Guys,

is there a way to edit the default number of products shown on each page?
Please have a look at the screenshot, attached at the end of this post.

Actually, there are 20 pieces each page preseted... i want them to set on 5 pieces each page as default value.

Anybody an idea how to handle it?


Thank you in advance for your help,
regards img

[attachment cleanup by admin]

img

  • Beginner
  • *
  • Posts: 15
anybody an idea? sorry for pushing this thread, but i have no idea to solve the problem myself

Luciffere

  • Jr. Member
  • **
  • Posts: 66
  • Web Design de Calitate
    • Web Design de Calitate
add $limit=5; in line after $ps_product_attribute = new ps_product_attribute;
in /administrator/com_virtuemart/html/shop.browse.php
Gift based on total order
Web design, logo, branding, joomla, virtuemart, flash. Portofoliu web design: http://www.luciffere.ro/portofoliu.html

kraizee

  • Beginner
  • *
  • Posts: 8
anybody an idea? sorry for pushing this thread, but i have no idea to solve the problem myself

take a look here:
https://forum.virtuemart.net/index.php?topic=40158.msg126535

kraizee

  • Beginner
  • *
  • Posts: 8
To set the steps the # of products are shown goto:

Joomla_1.5.x/administrator/components/com_virtuemart/classes/pageNavigation.class.php

and you'll find this around line 59:
Code: [Select]
  for ($i=6; $i <= 60; $i+=6) {
      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;
    }
change these values to your needs:
Code: [Select]
($i=6; $i <= 60; $i+=6)
the 1st value (6) is the smallest # of products shown
the 2nd value (60) is until which # of products it will count up in steps of the 3rd value (6).

In the following part you set the max # of products shown (90):
Code: [Select]
if (empty( $link)) {
      $limits[90] = 90;
    } else {
      $limits[vmRoute($link.'&limit=90')] = 90;
    }

 ;) this code is customized already maybe you'll find other values in your php file!

Lee Wilson

  • Jr. Member
  • **
  • Posts: 82
Fantastic, been meaning to look at this for a while, and this has saved me a load of time.

Thanks

nhradeuce

  • Beginner
  • *
  • Posts: 11
I just came across this and I got my answers. You can set quite a few different default items per page by changing the List Length parameter in the Joomla Global Configuration. If the default number you want to use is not listed there then you need to make the following changes.

In order for the number of items to list dropdown to work properly here is what you need to do -

in file /administrator/com_virtuemart/html/shop.browse.php around line 31 add
Code: [Select]
if ($_GET["limit"]=='') {
$limit=9;
}
If you just add the limit, your product listing pages will always show this number of items.

Then do the hack to administrator/components/com_virtuemart/classes/pageNavigation.class.php as outlined by Kraizee.

rockoladeluxe

  • Beginner
  • *
  • Posts: 4
I'm using Joomfish with Virtuemart, and this does not work for me..

My shop.browse limit is now on 6
and pageNavigation.class.php is like this: ($i=6; $i <=60; $i+=6)

So i got 6 product per page but can not get to page 1. (opening the category on the frontpage shows page 4 in stead of 1)
All other pages work fine most of the time,  depending on the numbers i use on
pageNavigation.class.php

Joomla 1.5.15
VM 1.1.4
Joomfish 2.03

rockoladeluxe

  • Beginner
  • *
  • Posts: 4
I made a mistake!

I ment sh404sef instead of Joomfish. Luckily i found the solution to both not working pagination and  dropdown menu in virutemart:

In sh04sef, go to advandced configuration (in blue, on the right) and then go to Plugins there you will find some configuration for Virtuemart.
The last option is to use  a dropdown list to choose the amount of prduct per page. Set it to YES, and the problem is solved (at least mina are)

I found the solution here: http://luke.gedeon.name/configuring-sh404sef-to-work-with-virtuemart-and-ten-other-extensions.html#awp::configuring-sh404sef-to-work-with-virtuemart-and-ten-other-extensions.html

yop

  • Beginner
  • *
  • Posts: 6
    • Web Designer
To set the steps the # of products are shown goto:

Joomla_1.5.x/administrator/components/com_virtuemart/classes/pageNavigation.class.php

and you'll find this around line 59:
Code: [Select]
  for ($i=6; $i <= 60; $i+=6) {
      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;
    }
change these values to your needs:
Code: [Select]
($i=6; $i <= 60; $i+=6)
the 1st value (6) is the smallest # of products shown
the 2nd value (60) is until which # of products it will count up in steps of the 3rd value (6).

In the following part you set the max # of products shown (90):
Code: [Select]
if (empty( $link)) {
      $limits[90] = 90;
    } else {
      $limits[vmRoute($link.'&limit=90')] = 90;
    }

 ;) this code is customized already maybe you'll find other values in your php file!

perfect kraizee, you did very much help for me, i search on how to set the number of product in a page...

jehanon

  • Jr. Member
  • **
  • Posts: 114
is there any normal new way to set how many products should be displayed per pages ?

thank you

abfxta

  • Beginner
  • *
  • Posts: 3
To set the steps the # of products are shown goto:

Joomla_1.5.x/administrator/components/com_virtuemart/classes/pageNavigation.class.php

and you'll find this around line 59:
Code: [Select]
  for ($i=6; $i <= 60; $i+=6) {
      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;
    }
change these values to your needs:
Code: [Select]
($i=6; $i <= 60; $i+=6)
the 1st value (6) is the smallest # of products shown
the 2nd value (60) is until which # of products it will count up in steps of the 3rd value (6).

In the following part you set the max # of products shown (90):
Code: [Select]
if (empty( $link)) {
      $limits[90] = 90;
    } else {
      $limits[vmRoute($link.'&limit=90')] = 90;
    }

 ;) this code is customized already maybe you'll find other values in your php file!
Thanks Kraizee, I read be carefully but I dont know why it's not show right.
When I click to menu, it's browse a category, and I want to show 9 products in a page, 3 products per row, anybody help me ?

jehanon

  • Jr. Member
  • **
  • Posts: 114
actually I am using browse_4 with 4 products / rows, I would like to get 8 rows = 32 products / page,  with the default values
 for ($i=5; $i <= 30; $i+=5)
I get 5 rows = 20 products / page

I don't undrestand very well how it works

what should be my code ?

I don't understand the steps of the 3rd in my cqase it is 4th value ?
many thanks

jehanon

  • Jr. Member
  • **
  • Posts: 114
how can I change the default value = 20 ?   I need 32 per pages by default

thank you

Mikuzi

  • Beginner
  • *
  • Posts: 4
Hi!

I just want to say Thank you!

I've been looking for this like a month and i finally fix the number of products per page.. thank's to you guys!


:D