This code is simplistic but can work ...
Usually, when you hit the Product listing ... the URL reads:
/index.php?main_page=index&cPath=53
This then processes that Category to work with the Maximum display setting ...
However ... if you want to override this, you can do so by creating an override of the file:
/includes/modules/products_listing.php
If you added a link ... for All to generate the URL:
/index.php?main_page=index&cPath=53&override=more
All you need do is edit the products_listing.php to include this IF to control what happens when your link adds that extra paramater ...
Change the line:
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
To the new IF statement ...
if ($_GET['override'] == 'more') {
$max_display_products_listing_override = $db->Execute($listing_sql);
$max_display_products_listing_override = $max_display_products_listing_override->RecordCount();
$listing_split = new splitPageResults($listing_sql, $max_display_products_listing_override, 'p.products_id', 'page');
} else {
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
}
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!