Jump to content

Changing the amount of products per page


Recommended Posts

Hi

I want to change the amount of products to view per page to be in increments of 9 rather than 10.

1. Where in back office do I alter to tell it that it's 9's not 10's

2. Where do I alter the values in the drop down to enable me to change the products to view per page options from 10.20. 30 in the front end?

Cheers

Anna

Link to comment
Share on other sites

  • 1 month later...

Hi,

To choose the number of products to show per page there's an easier way, through the b.o., in tab Preferences/Articles and there is an option to input the number of products per page that you want.
If you want to list all, that's simple, just put a high number like 100 in that field.

Hope that helps ;-)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 10 months later...
  • 6 months later...
  • 1 year later...
  • 10 months later...

I'm looking to increase the pagination options too -- adding 100 after 50 -- but things seem to be different now.

 

I've found FrontController.php in /classes/controller/

I've copied it and put it in /overrides/classes/controller/

 

However it has had no affect on my site. Any suggestions?

Link to comment
Share on other sites

Hi Bill,

 

That setting only allows you to change the number of products show per page. I have that set to 50 and it's working fine. However the drop down only shows these options for viewing products: 10, 20, 50. I would like to add 100 as an option on the drop-down.

 

Thanks.

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

You open file "class/controller/FrontController.php" in Prestashop 1.5

About line 834, you look for:

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

Change for the numbers of products needed.

Edited by vekia (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 6 months later...
  • 2 months later...
  • 2 years later...

You can add a "Show all" in Prestashop 1.6 with minor modifications (I would even call them bug fixes) on two files:

 

1 - In {theme}/nbr-product-page.tpl (line 63 and 64) modify the code to what you see in bold:

 

{if $nValue <= $nb_products} /* not sure why the complication of having a lastnValue, worked wrong anyway */

<option value="{$nValue|escape:'html':'UTF-8'}"{if $n == $nValue}selected="selected"{/if}>{if $nValue == $nb_products}All{else}{$nValue|escape:'html':'UTF-8'}{/if}</option>

 

2 - Then in classes/controllers/FrontContoller.php (line 1133) remove the part in bold:

 

if ((int)Tools::getValue('n') && (int)$total_products > 0) { /* not sure the value of adding the total number only when you you've selected a previous number?? */

Link to comment
Share on other sites

×
×
  • Create New...