[email protected] Posted December 29, 2016 Share Posted December 29, 2016 Hello, in prestashop 1.7 in the category page, how can I show all products in the same page? now it is showing only 12 products per page. I need something like the show all button. Thanks Ester the ca Link to comment Share on other sites More sharing options...
vekia Posted December 30, 2016 Share Posted December 30, 2016 hello this is possible but it can affect performance, especially if you have a lot of products associated with viewed category. you can increase value under "shop parameters > product" section in back office. there is a section "pagination". just change "products per page" value Link to comment Share on other sites More sharing options...
[email protected] Posted January 1, 2017 Author Share Posted January 1, 2017 Hi Vekia, Thanks, what I meant was the show all button on top and bottom of the category page and the total amount of products in that category, like it was in Prestashop 1.6, image attached . Thanks Ester Link to comment Share on other sites More sharing options...
miss-d Posted June 26, 2017 Share Posted June 26, 2017 Hi, regarding this topic: There was a frontend feature in 1.6 to let the customer chose how many products per page they wanted to show.... this is no longer available in 1.7 - Can this be somehow coded manually? I'd really be happy to have this feature back, and our customers too..... Link to comment Share on other sites More sharing options...
fredalva Posted July 26, 2017 Share Posted July 26, 2017 Hi, I'am also interesting to have this feature back Thanks Link to comment Share on other sites More sharing options...
Tsynique Posted August 11, 2017 Share Posted August 11, 2017 (edited) Hey all, I just re-added this feature to my 1.7 shop. It's actually not that difficult to do. Here's how I did it. I assume the default classic theme is used, so modify accordingly. 1. Open the file themes/{theme}/templates/_partials/pagination.tpl 2. There are two divs with class col-md-4 and col-md-6. In my case, I changed the first one from col-md-4 to col-md-3 3. Create a div between those two with class col-md-3 (or some other size, depending on your choice/design) 4. In that div, add a label and a select with choices. What I did, was I copied a styled select box from the theme I used and this is what I got: <label style="float:left;margin-right: 15px" class="form-control-label hidden-sm-down sort-label">{l s='Products per page:'}</label> <div style="float:left;" class="sort-select dropdown js-dropdown"> <a class="custom-select select-title" rel="nofollow" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {$results_per_page} </a> <div class="dropdown-menu"> <a rel="nofollow" href="?{$ordering}resultsPerPage=25" class="dropdown-item js-search-link"> 25 </a> <a rel="nofollow" href="?{$ordering}resultsPerPage=50" class="dropdown-item js-search-link"> 50 </a> <a rel="nofollow" href="?{$ordering}resultsPerPage=75" class="dropdown-item js-search-link"> 75 </a> <a rel="nofollow" href="?{$ordering}resultsPerPage=100" class="dropdown-item js-search-link"> 100 </a> </div> </div> 5. You will notice {$ordering} and {$results_per_page} variables. Add this code to the top of the template to handle them: {if !empty($smarty.get.order)} {capture assign='ordering'}order={$smarty.get.order}&{/capture} {else} {assign var='ordering' value=''} {/if} {if !empty($smarty.get.resultsPerPage)} {assign var='results_per_page' value=$smarty.get.resultsPerPage} {else} {assign var='results_per_page' value=25} {/if} 6. Either modify (not recommended) or override classes/controller/ProductListingFrontController.php. 7. Modify the line in the getProductSearchVariables() method which looks like this: if ($resultsPerPage <= 0 || $resultsPerPage > 36) { $resultsPerPage = Configuration::get('PS_PRODUCTS_PER_PAGE'); } to this: if ($resultsPerPage <= 0 || $resultsPerPage > 100) { $resultsPerPage = Configuration::get('PS_PRODUCTS_PER_PAGE'); } The only change is the maximum number (from 36 to 100). In my case it's 100, if in your case 36 is enough, then no modification is needed. 8. That's it! Edited August 11, 2017 by Tsynique (see edit history) 1 Link to comment Share on other sites More sharing options...
rachel01 Posted June 3, 2021 Share Posted June 3, 2021 Hello ! Thanks for this tutorial How I can do formulaire.7.6.4 ? This code is not working The value {capture assign='ordering'}order={$smarty.get.order}&{/capture} is not working Many thanks Link to comment Share on other sites More sharing options...
drummerooo Posted July 22 Share Posted July 22 Hello, I have exactly the same problem Quote capture assign='ordering'}order={$smarty.get.order}&{/capture} is not working. Everytime when user will check some checkbox with filter and then press "results per page" option from dropdown then in URL is only "https://xxxxx.com/xxxx?resultsPerPage=48 but if some filter is checked and basic URL is https://xxxxx.com/xxxxx?filter and then user will choose some "result per page" option then in URL it should be https://xxxxx.com/xxxxx?filter&resultsPerPage=48 If filter is checked or "?" is already added in URL then it should only add & How to fix it ? It's very important for me. 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