Jump to content
Sign in to follow this  
JariV

display number of items per page

Recommended Posts

I use 2.3.4.1 CE BS version.

I found a mod in a post with code by @Tsimi that is closed, that can display number of items per page in prducts listning but it did not work. Anyone know how I can change it to get it working ?

"For osC 2.3.4 BS (Bootstrap version GOLD or EDGE)

open catalog/includes/modules/product_listing.php"

FIND:

 <?php
    if (MODULE_HEADER_TAGS_GRID_LIST_VIEW_STATUS == 'True') {
      ?>

and ADD RIGHT ABOVE it this:

<?php
if (!tep_session_is_registered('max_products_per_page')) tep_session_register('max_products_per_page');
  if (!isset($max_products_per_page) || !is_integer($max_products_per_page) || ($max_products_per_page < 1)) $max_products_per_page = MAX_DISPLAY_SEARCH_RESULTS;
  if (isset($HTTP_GET_VARS['mppp']) && is_numeric($HTTP_GET_VARS['mppp']) && ($HTTP_GET_VARS['mppp'] > 0)) $max_products_per_page = intval($HTTP_GET_VARS['mppp']);
  $mppp_list = array();
  for ($i = 1; $i <= 5; $i += 1) { //change $i <= 5 to show more or less page options, default is 5 (Example: 12, 24, 36, 48, 60 (total: 5 options))
	$mppp = intval($i * 12); //change $i * 12 for products shown per page, default is 12
	$mppp_list[] = array('id' => $mppp, 'text' => $mppp);
	}
	$mppp_list[] = array('id' => 9999999, 'text' => TEXT_ALL_ITEMS);	
  $gvhf = '';
  $ignore = array('page', 'mppp');
  if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {
	reset($HTTP_GET_VARS);
	while (list($key, $value) = each($HTTP_GET_VARS)) {
	  if ( (strlen($value) > 0) && ($key != tep_session_name()) && (!in_array($key, $ignore)) ) {
		$gvhf .= tep_draw_hidden_field($key, $value);
	  }
	}
  }
  $maxpppform = tep_draw_form('prod_per_page', basename($PHP_SELF), 'get') . $gvhf . tep_draw_pull_down_menu('mppp', $mppp_list, $max_products_per_page, 'class="form-control input-sm" style="width:70px;" onchange="this.form.submit()"') . '</form>';
 $listing_split = new splitPageResults($listing_sql, $max_products_per_page, 'p.products_id');
?>
 <form class="form-inline pull-right">
	<label class="control-label"><?php echo TEXT_SHOW; ?></label>
	<?php echo $maxpppform; ?>
 </form>

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×