Jump to content

a better pagination


kingbbq

Recommended Posts

Hi all,

even it's my first website i'm making using prestashop, i'm an experienced PHP hard-coder.

i hope it's not an allready known issue but i would like to introduce a little hack to the pagination system, very useful if your default number of products per page looks like 12, 16, 15 or still 10.

In pagination.php

$nArray = intval(Configuration::get('PS_PRODUCTS_PER_PAGE')) != 10 ? array(intval(Configuration::get('PS_PRODUCTS_PER_PAGE')), 10, 20, 50) : array(10, 20, 50);
asort($nArray);



becomes

$hack_products_per_page = intval(Configuration::get('PS_PRODUCTS_PER_PAGE'));
$nArray = array($hack_products_per_page, $hack_products_per_page * 2, $hack_products_per_page * 5);



In my mind it will be great to see this included for every one.
Making this hack, correct me if i'm wrong, u may alter the pagination.tpl by line 48

//{if $nb_products > 10}
{if $nb_products > $n}




Thanks for appreciate. As i'm french, i gonna send this to our dedicated forum.
Peace

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...