
Originally Posted by
mhawkins
These are the files I added:
2 files in extra functions(set_num_products & set_num_product_dd) and lang/english/template/set_num_products, and of course the modifications to modules/template/product_listing and templates/mytemplate/template/tple_modules_product_listing.
you need to choose 1 or the other in the extra functions folder:
set_num_products is standard file
set_num_product_dd is my addition (as a drop down)
this mod only works with column grid installed as far as I know.
in /includes/modules/your_template_name/product_listing.php
find:
PHP Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
add right below it:
PHP Code:
// BOF Number of Items Per Page
if(isset($_POST['max_display']) || isset($_GET['max_display'])) {
$_SESSION['product_listing_max_display'] = (int)$_REQUEST['max_display'];
} elseif (!isset($_SESSION['product_listing_max_display'])) {
$_SESSION['product_listing_max_display'] = (int)MAX_DISPLAY_PRODUCTS_LISTING;
}
// EOF Number of Items Per Page
then find:
PHP Code:
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
change to:
PHP Code:
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];
then in /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_product_listing.php
find:
<?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>
add right below it:
if using standard
PHP Code:
<!--bof set num products -->
<?php
if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?>
<div id="maxProductsListingTop" class="navSplitPagesResult forward"><?php echo TEXT_DISPLAY_STEPS_NUMBER_OF_PRODUCTS;
echo draw_max_display($_GET['main_page'], $listing_split->page_name, (int)PRODUCT_LISTING_COLUMNS_PER_ROW, $listing_split->number_of_rows);
?>
</div>
<?php } ?>
<!--eof set num products -->
or if using my addition to add a dropdown
PHP Code:
<!--bof set num products ( dropdown ) -->
<?php if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?>
<form>
<select onchange="if (this.value) window.location.href=this.value">
<option value="[Select One]">Products per Page
<?php echo draw_max_display($_GET['main_page'], $listing_split->page_name, (int)PRODUCT_LISTING_COLUMNS_PER_ROW, $listing_split->number_of_rows); ?>
</select>
</form>
<?php } ?>
<!--eof set num products ( dropdown ) -->
but not both
Bookmarks