artofadornment Posted May 16, 2013 Share Posted May 16, 2013 (edited) Hi all, I'm using PS 1.5.3.1 and I'm wondering if there is a way that I can limit the number of products that are displayed when the "New Products" page loads (not the block, the actual page). I'd like to set the limit to 12, could someone help with what code I need? I am assuming that I need to change new-products.tpl but I have no idea what to put there. Thank you in advance! ~ Elaine Edited to clarify: I don't mean that I want to show 12 products per page, I mean that I want to have a maximum of 12 products displayed in total (so that there is only one New Products page and there are only 12 products showing on it). Edited May 17, 2013 by artofadornment (see edit history) Link to comment Share on other sites More sharing options...
kadziola.jarek Posted May 17, 2013 Share Posted May 17, 2013 In block you can set limit insite configuration module Per page you must edit file controllers/front/NewProductsControllers.php, line 60. Edit this code: 'products' => Product::getNewProducts($this->context->language->id, (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay), on 'products' => Product::getNewProducts($this->context->language->id, (int)($this->p) - 1, 12, false, $this->orderBy, $this->orderWay), Link to comment Share on other sites More sharing options...
artofadornment Posted May 17, 2013 Author Share Posted May 17, 2013 Thank you, but that's not quite what I'm looking for (I may not be wording this correctly). I already have the FO set to display 12 products on any given page by default. But for the "new products" page only, I only want to show only the 12 most recently added products (not page after page of new products - just one page with 12 products on it, no pagination). So regardless how many new products there actually are in the entire catalogue, only the 12 newest products would be displayed on the "new products" page, period. The reason for this that I have just imported all of my products from osCommerce, so right now, technically speaking, *all* 250 products are brand new. I want to set my "Number of days for which the product is considered 'new'" to be a high number (e.g. 60 days) so that in the future there will always be at least a few items on that page (I add 1-2 new items every week). However I don't want all 250 products sitting there for the next two months, misleading people into thinking that I have 21 pages of brand new products. So I need just one page, no pagination, with 12 new products on it. Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2013 Share Posted May 17, 2013 hey you have to edit both controller and template file: controller ( controllers / front / newproductscontroller.php ) change the 'products' => Product::getNewProduct() function to: 'products' => Product::getNewProducts($this->context->language->id, 0, 12, false, $this->orderBy, $this->orderWay) then in themes / YOUR_THEME / new-products.tpl remove the: {include file="./pagination.tpl"} 2 Link to comment Share on other sites More sharing options...
artofadornment Posted May 17, 2013 Author Share Posted May 17, 2013 YES!!! Of course, that did the trick (can you tell that I'm not very good at this stuff? haha!). Thank you so much! Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2013 Share Posted May 17, 2013 im glad that i could help you in this case :-) thanks for marking thread as solved regards Link to comment Share on other sites More sharing options...
onlinez Posted July 10, 2015 Share Posted July 10, 2015 Same thing in Prestashop 1.6? Link to comment Share on other sites More sharing options...
purehelder Posted January 16, 2019 Share Posted January 16, 2019 Hi is there any solution for the side products-block, to show only 6 produtcs, for instance? Thanks in advance? 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