Joomla Virtuemart – Pagination Mod.(Hacks)

  • Share
  • Share

introduction

Problem with the pagination of Virtuemart

From the regular Virtuemart installation, I am not able to change the product pagination display format. My client would like to change the display method to 15 – 30 – 45 and max. 60 products to display other then the default 5, 10, 15, 20, 25, 30.

old_view

Modification hacks to the pageNavigation.class.php

So we will need to rewrite the code a bit. We kinda simplify some code for this purpose. So it will look something like this.
new_view

Original Code from pageNavigation.class.php located at administrator/components/com_virtuemart/classes/. Open the php file and look for the below code.
Original

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;
}

Modification

// change the number of items display which should be divided by 15
// And the maximum number to display is 60
for ($i=15; $i <= 60; $i+=15) {
  if (empty( $link)) {
    $limits[$i] = $i;
  } else {
    $limits[vmRoute($link.'&limit='.$i)] = $i;
  }
}
// Code Provided by DesignerSandbox.com

Be a link sponsor for this page now

[sponsorbox]


Related Posts Plugin for WordPress, Blogger...

I hope you have enjoyed this post, be sure to subscribe to my rss feed by click the subscribe button at the top.

Good Luck!

Be Sure to Subscribe to our feed or follow us on twitter to get the latest updates/patches
End of Article, Thanks for reading.
You can leave a response, or trackback from your own site.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

5 Responses to “Joomla Virtuemart – Pagination Mod.(Hacks)

  1. Shy LaNef says:

    Well-written. Thanks. I have been learning a lot about different CMS programs lately. I have also been experimenting with setting up an e-commerce site using WordPress. Have you ever done that? Any suggestions for me? It’s pretty fun learning it. If you’d like to see my blog it’s here. Thanks again for this blog – it is really well-done.

  2. Hi – just a little note to say thank you for this article. Very good.

  3. Thanks… worked perfectly… been wracking my brain over this issue for a while.

  4. berlin80210 says:

    Thanks for the fix! I've been searching for this snippit for quite some time :-)

Leave a Reply