Jump to content

Change number of products per page increments?


chamber715

Recommended Posts

Is there any way I can change the number of products per page increments? I'm changing my product list layout to a grid with 3 columns, so I'd like the increments to be something like 12, 24 and 36. I know I can change the initial number of products in the Preferences, but I don't see any way to change the increments there.

 

I've searched this forum and found some topics, but they all seem to be for older versions of Prestashop. I'm currently on 1.5.2.

Link to comment
Share on other sites

Ok, so I kind of solved my own problem... I'm pretty sure the product per page increments are hard coded into frontController.php in the "classes" directory. I could've replaced the hard coded values with my preferred values, but I figured that's probably not the best idea since there's a chance that file will get overwritten if I upgrade my Prestashop installation in the future.

 

So instead, I modified nbr-product-page.tpl in the theme I was using. There's a line in that file:

{foreach from=$nArray item=nValue}

that I believe grabs the values from frontController.php and builds the drop down box for the number of products per page.

 

So what I did was created my own array of values to build the drop down box. I commented out the original foreach loop in case nArray does something else I'm not aware of. So I replaced the above line of code with these three lines instead:

{assign var="newNumbering" value=[12,24,36,48]}

{foreach from=$newNumbering item=nValue}

{*foreach from=$nArray item=nValue*}

 

I haven't tested this solution extensively, so there may be side effects that I'm not seeing yet, but so far it works. Hopefully, this can help out those of you who want to do something similar.

Link to comment
Share on other sites

  • 3 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...