JariV Posted March 21, 2019 Share Posted March 21, 2019 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> Link to comment Share on other sites More sharing options...
freakystreak Posted June 26, 2019 Share Posted June 26, 2019 I think you have to change all instances of $HTTP_GET_VARS to $_GET Ah, the world wide web. What a wonderful place. Link to comment Share on other sites More sharing options...
ArtcoInc Posted June 26, 2019 Share Posted June 26, 2019 @JariV What version of PHP are you using? M Link to comment Share on other sites More sharing options...
♥JcMagpie Posted June 26, 2019 Share Posted June 26, 2019 On 3/21/2019 at 9:24 AM, JariV said: Anyone know how I can change it to get it working ? Link to comment Share on other sites More sharing options...
ArtcoInc Posted June 26, 2019 Share Posted June 26, 2019 FWIW, the OP posted this question three months ago, and has not been back since. M Link to comment Share on other sites More sharing options...
♥JcMagpie Posted June 26, 2019 Share Posted June 26, 2019 😂 Never mind may be of use to someone else. Link to comment Share on other sites More sharing options...
SCH_001 Posted July 6, 2019 Share Posted July 6, 2019 Hi all using frozen BS and this works ok for categories listings but when I use search I get the below can someone please help with how to fix this product_listing.php <!-- start display number of items per page --> <?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($_GET['mppp']) && is_numeric($_GET['mppp']) && ($_GET['mppp'] > 0)) $max_products_per_page = intval($_GET['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 * 20); //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($_GET) && (sizeof($_GET) > 0)) { reset($_GET); while (list($key, $value) = each($_GET)) { 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; margin-right:10px" onchange="this.form.submit()"') . '</form>'; $listing_split = new splitPageResults($listing_sql, $max_products_per_page, 'p.products_id'); ?> <!-- end display number of items per page --> Link to comment Share on other sites More sharing options...
SCH_001 Posted July 6, 2019 Share Posted July 6, 2019 Sorry the part of the above is <!-- start display number of items per page --> <form class="form-inline pull-right"> <label class="control-label"><?php echo TEXT_SHOW; ?></label> <?php echo $maxpppform; ?> </form> <!-- end display number of items per page --> not this works ok with looking at categories Link to comment Share on other sites More sharing options...
♥JcMagpie Posted July 6, 2019 Share Posted July 6, 2019 add this to your language file /public_html/includes/languages/english.php //display number of items per page define('TEXT_ALL_ITEMS', 'show them all'); define('TEXT_SHOW','Show '); Link to comment Share on other sites More sharing options...
SCH_001 Posted July 6, 2019 Share Posted July 6, 2019 Thank you that fixed it. I had define('TEXT_ALL_ITEMS', 'show them all'); but not the define('TEXT_SHOW','Show '); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.