Jump to content

Change Default Product List view Back Office


mpouliot34

Recommended Posts

Hello

 

PrestaShop version: 1.6.0.6

Current theme in use: default-bootstrap

 

I am wondering where I can change the default display value of products in the product list view.

I know I can change the item count at the bottom but whenever I log out and back in it does not show by default.

I woulld like to at lease see for example 200 items when I load the section.

 

On the same section I am also wondering if it is possible to NOT display items that are not in stock by default. 

 

Thanks

 

:)

Link to comment
Share on other sites

  • 4 weeks later...

Its been long, but i m try to give a solution,

 

The limit options in the drop down are declared and defined in classes/controller/AdminController.php:

Have a look into this.

/** @var array Number of results in list per page (used in select field) */
protected $_pagination = array(20, 50, 100, 300, 1000);`

The default pagination limit (on first load) is defined directly below: (if you put 20,100, 300 but make sure that whatever the value you put that should be exist in $_pagination array )

/** @var int Default number of results in list per page */
protected $_default_pagination = 50;

You can change this variable by overriding AdminController,  

read more about overriding here: 

http://doc.prestashop.com/display/PS16/Overriding+default+behaviors#Overridingdefaultbehaviors-Overridingaclass

 
Please don't do changes in directly in core Files. take a backup of AdminController file.
Clear cache your folder.
 
Happy coding
 
Link to comment
Share on other sites

  • 1 year later...

Hi. I am on 1.7.

I found this field in Admincontroller.php :  protected $_pagination = array(20, 50, 100, 300, 1000)

However, my backoffice shows only "20,50,100" and is set to 100 by default.

So it is not matching at all.

If I set it as protected $_pagination = array(20, 50, 100, 500, 4000) and sets let say 500 as default, still the same. No change despite caches cleared.

 

Is that the correct field ???

 

post-1437705-0-00963100-1508234698_thumb.png

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

The only way i found that work is by doing something like that:

2089381187_codechange.PNG.d56251690fbb9a223b0f48ebb24ff49e.PNG

I dont get it how it works but it makes the point :D
I use Firefox and thats the code inspector...
that object can be found at the box with selection of the default numbers 20, 50, 100, 300


 

screen4.PNG

screen3.PNG

screen2.PNG

Link to comment
Share on other sites

On 10/17/2017 at 12:05 PM, sro1234 said:

Hi. I am on 1.7.

I found this field in Admincontroller.php :  protected $_pagination = array(20, 50, 100, 300, 1000)

However, my backoffice shows only "20,50,100" and is set to 100 by default.

So it is not matching at all.

If I set it as protected $_pagination = array(20, 50, 100, 500, 4000) and sets let say 500 as default, still the same. No change despite caches cleared.

 

Is that the correct field ???

 

post-1437705-0-00963100-1508234698_thumb.png

The only way i found that work is by doing something like that:

2089381187_codechange.PNG.d56251690fbb9a223b0f48ebb24ff49e.PNG

I dont get it how it works but it makes the point :D
I use Firefox and thats the code inspector...
that object can be found at the box with selection of the default numbers 20, 50, 100, 300


 

screen4.PNG

screen3.PNG

screen2.PNG

Link to comment
Share on other sites

  • 2 years 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...