Jump to content

Change the number of product per page according to category


diedm

Recommended Posts

Hello,

I need to set a different number of product per page according to specific category.

E.g.: I have a global product pagination value = 6. For a specific category I need to show only 5 products per page, because one of the product box will be used by image category.

Is there a way to implement this?

 

Thanks in advance

 

Diedm

Link to comment
Share on other sites

I found the answer.

In FrontController.php after this line (function pagination)

 

$this->p = abs((int)Tools::getValue('p', 1));

 

I added this statement:

------------------------------------------------

 

if ($this->category->id_parent==12){

$this->n=5;

}

------------------------------------------------

where 12 is the parent category id of all subcategory where I want to apply the number 5 pagination.

 

Hope that this helps somebody else.

 

Thanks

 

diedm

  • Like 1
Link to comment
Share on other sites

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