xuthiensun Posted May 27, 2013 Share Posted May 27, 2013 (edited) Hello all! I have a problem which is similar to this topic that was solved: http://www.prestasho...ng-to-category/ Unfortunately, the code that was provided does not work with what I have, and I do not know what version that person used for the solution. I'm currently using 1.5.4.0. If there are any existing solutions, or if anyone knows how to solve this, please point me in the right direction. Thank you! Edited May 28, 2013 by xuthiensun (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted May 27, 2013 Share Posted May 27, 2013 This code piece is found in /classes/controller/FrontController.php (line 824 onward): public function pagination($nbProducts = 10) { if (!self::$initialized) $this->init(); elseif (!$this->context) $this->context = Context::getContext(); $nArray = (int)Configuration::get('PS_PRODUCTS_PER_PAGE') != 10 ? array((int)Configuration::get('PS_PRODUCTS_PER_PAGE'), 10, 20, 50) : array(10, 20, 50); // Clean duplicate values $nArray = array_unique($nArray); asort($nArray); $this->n = abs((int)(Tools::getValue('n', ((isset($this->context->cookie->nb_item_per_page) && $this->context->cookie->nb_item_per_page >= 10) ? $this->context->cookie->nb_item_per_page : (int)Configuration::get('PS_PRODUCTS_PER_PAGE'))))); $this->p = abs((int)Tools::getValue('p', 1)); After this last line, you should add the solution given in the post you mentioned. Not sure if it works for you, but give it a try. (N.B. the post uses a fixed category ID of '12'. This will probably need to be changed into the category you need to adjust yourself...) Hope this helps, pascal 1 Link to comment Share on other sites More sharing options...
xuthiensun Posted May 28, 2013 Author Share Posted May 28, 2013 Hi Pascal, Thanks for the reply. Unfortunately that's the thing that isn't working. I've changed the ID to the one that I needed, and I've pasted the code after that chunk, but it doesn't seem to work. Link to comment Share on other sites More sharing options...
xuthiensun Posted May 28, 2013 Author Share Posted May 28, 2013 (edited) Ah I've figured out the problem! The line of code was using the variable "id_parent". I simply changed it to "id" and it works. if($this->category->id==13){ $this->n = 10; } Replace the number to the appropriate category. Hope this will be useful to others! Edited May 28, 2013 by xuthiensun (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted May 28, 2013 Share Posted May 28, 2013 Glad you've found it! Good luck with your shop, pascal Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now