Mail Bag

Answering Your Questions Since... 9:30am
Joined: 28 Aug 2005
Posts: 113
|
Posted: Jun 12, 2008 04:07pm Post subject: Override the default 25 results per page |
|
|
| Quote: | | I was wondering how to set the default number of products shown on the category pages and storefront pages. I would like to change the default amount shown from 25 to only 10. Is this possible? |
This can be done, but it requires adding a little PHP code to the beginning of the HTML template for those store page you'd like to change. The PHP code to add looks like this:
| Code: | <?php
if(($_SESSION[$basename]['rpp']=='25') && (!isset($_POST['rpp']))) {
$_SESSION[$basename]['rpp']='X';
}
?> |
Change X to the desired default number of results per page.
Note: This code will need to be added to each template you want to override the default number of results on.
For example, adding the code sample above to the storefront template with X set to "4" will cause four products to be displayed at a time on the storefront page (the store's home page). However, this won't affect the default results per page on the category page, that page will still display 25 products by default. To also change the number of default products per page, the sample PHP code would need to be added to the category template too.
I hope this information is helpful. Let us know if there's anything else we can help you with. _________________ Modular Merchant Mail Bag
Answering your questions, queries and puzzlers.
Modular Merchant shopping cart software, website hosting, and custom programming. |
|