In my last project I got a requirement from my client to restrict the virtuemart product pages to display total and maximum 6 products in a page by default, then I noticed that under virtuemart 1.1.9 admin there is no option to set the number of products to display on each product page.

Here I got the best solution to achieve the scenario –

Setting default number of product to display on product pages in virtuemart

1. Locate the file in your admin virtuemart folder
/administrator/components/com_virtuemart/classes/pageNavigation.class.php
2. Search for the below code

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

3. Update the # in the above for loop as per your requirement so -
the 1st value (5) is the smallest # of products shown, or say the very first value going to be display in pagination dropdown
the 2nd value (30) is until which # of products it will count up in steps of the 3rd value (5), so this will be like 5×1=5,5×2=10,5×3=15…..5×6=30.

Go ahead and check your product pages get starting to display number of products as per your choice, and along with that “Display” dropdown under pagination get also filled with new options as per changes and requirement

Your output will look something like this –

Virtuemart – Setting total number of products to display on product pages

Related posts:

Author:

is co-founder and author of tips4developer. By profession he is a WordPress and Joomla developer.


Subscribe to email feed

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin

Joomla – Allowing

Recently I got an requirement to add multiple email ID’s ...

WordPress - Controll

Page Lists Plus is one of the most use full ...

IE compatible mode

I noticed most of the web developers and designers hate ...

Adding PayPal Donate

Adding PayPal Donate Button in WordPress Post and Page are ...

Multi Browsers CSS H

Here I am sharing few of the very useful multi ...

Joomla – Allowing

Recently I got an requirement to add multiple email ID’s ...

Virtuemart – Setti

In my last project I got a requirement from my ...

3 Best Security Ext

Joomla is one of the fastest growing and best CMS ...

Joomla Conditional S

With the help of Joomla conditional statements you will able ...

Virtuemart - Special

Here I am sharing the virtuemart code snippet to display ...