Forums / All Other Contributions/Addons / Set number of products displayed per page (support thread)

Set number of products displayed per page (support thread)

Views: 37,000

Results 61 to 80 of 148
4 Jun 2012, 10:13 AM
#61
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Set number of products displayed per page (support thread)

I got this working as a drop-down!
I got it working in Gallery View (Columns)
I got it working in Grid View (Columns)

I would like to get it to work in List View (Rows)

25 Jun 2012, 8:44 PM
#62
corseter avatar

corseter

New Zenner

Join Date:
Jun 2010
Location:
Crossmolina, Ireland
Posts:
55
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Hi,
I have this mod installed but do not see anything on the website. What am I missing? I am running 1.3.8 and have the column layout set.
Website is http://corset.ie

Thanks,

24 Sep 2012, 3:26 PM
#63
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Set number of products displayed per page (support thread)

rbarbour:

I got this working as a drop-down!
I got it working in Gallery View (Columns)
I got it working in Grid View (Columns)

I would like to get it to work in List View (Rows)

Hi rbarbour
Do you want to share your code for the drop-down?
I am currently combining this mod with Column Layout / Grid Layout for Products Listing and it works perfect in both grid and list view, but i would like the numbers to in a drop-down.

28 Sep 2012, 4:29 AM
#64
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Set number of products displayed per page (support thread)

I submitted an updated version in the add-ons section to include a (optional dropdown)

22 Oct 2012, 6:28 PM
#67
tiptop avatar

tiptop

New Zenner

Join Date:
Sep 2012
Posts:
6
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

PLS help me I have just messed up my site with installing this module,I dont think I did the installation rightly,my site is not showing anything at all,though I have my database backed up.I think where the problem is is the tpl_modules_product_listing.php and the merging of codes.pls help me what can I do,
i have copied my tpl_modules_product_listing.php code here,pls help me check it maybe I did something wrong.thanks in advance

<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $ * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING 04/04/2006 * Modified for admin control of customer option by Glenn Herbert (gjh42) 2012-09-21 & add grid sorter 2012-09-29 */ include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCT_LISTING)); ?> <div id="productListing"> <?php // only show when there is something to submit and enabled if ($show_top_submit_button == true) { ?> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?></div> <br class="clearBoth" /> <?php } // show top submit ?> <?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <div id="productsListingTopNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> <!--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 --> <!--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 ) --></div> <div id="productsListingListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div> <br class="clearBoth" /> <?php } ?> <?php /** * load the list_box_content template to display the products */ if ($product_listing_layout_style == 'columns') { if (PRODUCT_LISTING_GRID_SORT) { echo '<ul id="gridSorter">' . PRODUCT_LISTING_GRID_SORT_TEXT; for ($col=0;$col<sizeof($grid_sort);$col++) { echo '<li class="item">' . $grid_sort[$col]['text'] . '</li>'; } echo '</ul>'; } require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php'); } else {// (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_tabular_display.php'); } ?> <?php if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <div id="productsListingBottomNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> <!--bof set num products --> <?php if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?> <div id="maxProductsListingBottom" 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 --></div> <div id="productsListingListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div> <br class="clearBoth" /> <?php } ?> <?php // only show when there is something to submit and enabled if ($show_bottom_submit_button == true) { ?> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit2" name="submit1"'); ?></div> <br class="clearBoth" /> <?php } // show_bottom_submit_button ?> </div> <?php // if ($show_top_submit_button == true or $show_bottom_submit_button == true or (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0)) { if ($show_top_submit_button == true or $show_bottom_submit_button == true) { ?> </form> <?php } ?>
22 Oct 2012, 6:36 PM
#68
tiptop avatar

tiptop

New Zenner

Join Date:
Sep 2012
Posts:
6
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

IN ADDITION this is my product_listing.php
pls help me check what is wrong with my codes.thank you so much in advance.I am using zen 1.3.9

<?php /** * product_listing module * * @package modules * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $ * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } // 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 // Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004 // Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004 // Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006 // Column Layout Support (Grid Layout) upgraded for v1.5.0 compatibility and changed to customer control asarfraz July 26 2012 // Modified for admin control of customer option by Glenn Herbert (gjh42) 2012-09-20 test 20120929 grid sorter // if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE',(isset($_GET['view']) ? $_GET['view'] : 'rows')); if (!defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3); if (!defined('PRODUCT_LISTING_GRID_SORT')) define('PRODUCT_LISTING_GRID_SORT',0); $product_listing_layout_style = isset($_GET['view'])? $_GET['view']: PRODUCT_LISTING_LAYOUT_STYLE; $row = 0; $col = 0; $list_box_contents = array(); $title = ''; $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']; $show_submit = zen_run_normal(); $listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page'); $zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows); $how_many = 0; // Begin Row Layout Header if ($product_listing_layout_style == 'rows' or PRODUCT_LISTING_GRID_SORT) { // For Column Layout (Grid Layout) add on module $list_box_contents[0] = array('params' => 'class="productListing-rowheading"'); $zc_col_count_description = 0; $lc_align = ''; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; $zc_col_count_description++; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; $zc_col_count_description++; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; $zc_col_count_description++; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : ''); $zc_col_count_description++; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; $zc_col_count_description++; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; $zc_col_count_description++; break; case 'PRODUCT_LIST_IMAGE': if ($product_listing_layout_style == 'rows') { //skip if grid $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; $zc_col_count_description++; } break; } if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text); } $list_box_contents[0][$col] = array('align' => $lc_align, 'params' => 'class="productListing-heading"', 'text' => $lc_text ); } if ($product_listing_layout_style == 'columns') { //grid sort option $grid_sort = $list_box_contents[0]; $list_box_contents = array(); } } // End Row Layout Header used in Column Layout (Grid Layout) add on module ///////////// HEADER ROW ABOVE ///////////////////////////////////////////////// $num_products_count = $listing_split->number_of_rows; if ($listing_split->number_of_rows > 0) { $rows = 0; // Used for Column Layout (Grid Layout) add on module $column = 0; if ($product_listing_layout_style == 'columns') { if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) { $col_width = floor(100/$num_products_count) - 0.5; } else { $col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5; } } // Used for Column Layout (Grid Layout) add on module $listing = $db->Execute($listing_split->sql_query); $extra_row = 0; while (!$listing->EOF) { if ($product_listing_layout_style == 'rows') { // Used in Column Layout (Grid Layout) Add on module $rows++; if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) { $list_box_contents[$rows] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[$rows] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; } // End of Conditional execution - only for row (regular style layout) $product_contents = array(); // Used For Column Layout (Grid Layout) Add on module for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = $listing->fields['products_model']; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ; } else { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>'; break; case 'PRODUCT_LIST_PRICE': $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />'; $lc_align = 'right'; $lc_text = $lc_price; // more info in place of buy now $lc_button = ''; if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') { $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; } else { if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) { if ( // not a hide qty box product $listing->fields['products_qty_box_status'] != 0 && // product type can be added to cart zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N' && // product is not call for price $listing->fields['product_is_call'] == 0 && // product is in stock or customers may add it to cart anyway ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) { $how_many++; } // hide quantity box if ($listing->fields['products_qty_box_status'] == 0) { $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>'; } else { $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />"; } } else { // qty box with add to cart button if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) { $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>'; } else { $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>'; } } } $the_button = $lc_button; $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']); $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : ''); break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = $listing->fields['products_quantity']; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = $listing->fields['products_weight']; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { $lc_text = ''; } else { if (isset($_GET['manufacturers_id'])) { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; } else { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; } } break; } $product_contents[] = $lc_text; // Used For Column Layout (Grid Layout) Option if ($product_listing_layout_style == 'rows') { $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } } // add description and match alternating colors //if (PRODUCT_LIST_DESCRIPTION > 0) { // $rows++; // if ($extra_row == 1) { // $list_box_description = "productListing-data-description-even"; // $extra_row=0; // } else { // $list_box_description = "productListing-data-description-odd"; // $extra_row=1; // } // $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"', // 'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)); //} // Following code will be executed only if Column Layout (Grid Layout) option is chosen if ($product_listing_layout_style == 'columns') { $lc_text = implode('<br />', $product_contents); $list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => $lc_text); $column ++; if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) { $column = 0; $rows ++; } } // End of Code fragment for Column Layout (Grid Layout) option in add on module $listing->MoveNext(); } $error_categories = false; } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); $error_categories = true; } if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) { $show_top_submit_button = true; } else { $show_top_submit_button = false; } if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) { $show_bottom_submit_button = true; } else { $show_bottom_submit_button = false; } if ($how_many > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0) { // bof: multiple products echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"'); } ?>
22 Oct 2012, 6:38 PM
#69
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Set number of products displayed per page (support thread)

We really need both original copies of the file (from the Column Grid and the Set Number mods) to be able to advise correctly. Have you compared each of them to the original stock version, to see where each mod makes changes (take notes with line numbers and code)? That is the first step you need to take.

Then if they modify separate lines, you can just merge the custom parts into one file. If they both change the same line somewhere, it will require expert attention.

22 Oct 2012, 7:11 PM
#70
tiptop avatar

tiptop

New Zenner

Join Date:
Sep 2012
Posts:
6
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Wow thanks gjh42,very fast reply thank you. i will copy and paste the two files below,but pls i do not understand what you meant by original stock version,I have only installed the column grid and the set number mods and I actually installed the column grid over 10days ago and it worked perfectly but yesterday I decided to installed the set mods and added the code as stated in the installation manual which i will copy from now.thank you for helping me.the manual says we should merge the following codes into the product listing.php and tplmoduleproductslisting.php :

Edit /includes/modules/YOUR_TEMPLATE/product_listing.php
If you don't already have a modified product_listing.php in /includes/modules/YOUR_TEMPLATE/, then create one there first.
If you already have one, merge these changes into it.

Find:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}

Add below:
// 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

Find:
$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;

Replace by:
$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'];
Edit /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_product_listing.php

Find (this fragment occurs twice, at the top and bottom of the displayed page):

<?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>

and paste the following code segments under the fragments.

For the first paste, at the top of the page add:

<!--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 -->

<!--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 ) -->

For the second paste, for the bottom of the page add:

<!--bof set num products --> <?php if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?> <div id="maxProductsListingBottom" 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 -->

............................................................
..THE ORIGINAL copy of the COLUMN GRID is:
product_listing.php file:

<?php /** * product_listing module * * @package modules * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $ * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } // Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004 // Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004 // Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006 // Column Layout Support (Grid Layout) upgraded for v1.5.0 compatibility and changed to customer control asarfraz July 26 2012 // Modified for admin control of customer option by Glenn Herbert (gjh42) 2012-09-20 test 20120929 grid sorter // if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE',(isset($_GET['view']) ? $_GET['view'] : 'rows')); if (!defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3); if (!defined('PRODUCT_LISTING_GRID_SORT')) define('PRODUCT_LISTING_GRID_SORT',0); $product_listing_layout_style = isset($_GET['view'])? $_GET['view']: PRODUCT_LISTING_LAYOUT_STYLE; $row = 0; $col = 0; $list_box_contents = array(); $title = ''; $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; $show_submit = zen_run_normal(); $listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page'); $zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows); $how_many = 0; // Begin Row Layout Header if ($product_listing_layout_style == 'rows' or PRODUCT_LISTING_GRID_SORT) { // For Column Layout (Grid Layout) add on module $list_box_contents[0] = array('params' => 'class="productListing-rowheading"'); $zc_col_count_description = 0; $lc_align = ''; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; $zc_col_count_description++; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; $zc_col_count_description++; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; $zc_col_count_description++; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : ''); $zc_col_count_description++; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; $zc_col_count_description++; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; $zc_col_count_description++; break; case 'PRODUCT_LIST_IMAGE': if ($product_listing_layout_style == 'rows') { //skip if grid $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; $zc_col_count_description++; } break; } if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text); } $list_box_contents[0][$col] = array('align' => $lc_align, 'params' => 'class="productListing-heading"', 'text' => $lc_text ); } if ($product_listing_layout_style == 'columns') { //grid sort option $grid_sort = $list_box_contents[0]; $list_box_contents = array(); } } // End Row Layout Header used in Column Layout (Grid Layout) add on module ///////////// HEADER ROW ABOVE ///////////////////////////////////////////////// $num_products_count = $listing_split->number_of_rows; if ($listing_split->number_of_rows > 0) { $rows = 0; // Used for Column Layout (Grid Layout) add on module $column = 0; if ($product_listing_layout_style == 'columns') { if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) { $col_width = floor(100/$num_products_count) - 0.5; } else { $col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5; } } // Used for Column Layout (Grid Layout) add on module $listing = $db->Execute($listing_split->sql_query); $extra_row = 0; while (!$listing->EOF) { if ($product_listing_layout_style == 'rows') { // Used in Column Layout (Grid Layout) Add on module $rows++; if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) { $list_box_contents[$rows] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[$rows] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; } // End of Conditional execution - only for row (regular style layout) $product_contents = array(); // Used For Column Layout (Grid Layout) Add on module for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = $listing->fields['products_model']; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ; } else { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>'; break; case 'PRODUCT_LIST_PRICE': $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />'; $lc_align = 'right'; $lc_text = $lc_price; // more info in place of buy now $lc_button = ''; if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') { $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; } else { if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) { if ( // not a hide qty box product $listing->fields['products_qty_box_status'] != 0 && // product type can be added to cart zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N' && // product is not call for price $listing->fields['product_is_call'] == 0 && // product is in stock or customers may add it to cart anyway ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) { $how_many++; } // hide quantity box if ($listing->fields['products_qty_box_status'] == 0) { $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>'; } else { $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />"; } } else { // qty box with add to cart button if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) { $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>'; } else { $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>'; } } } $the_button = $lc_button; $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']); $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : ''); break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = $listing->fields['products_quantity']; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = $listing->fields['products_weight']; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { $lc_text = ''; } else { if (isset($_GET['manufacturers_id'])) { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; } else { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; } } break; } $product_contents[] = $lc_text; // Used For Column Layout (Grid Layout) Option if ($product_listing_layout_style == 'rows') { $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } } // add description and match alternating colors //if (PRODUCT_LIST_DESCRIPTION > 0) { // $rows++; // if ($extra_row == 1) { // $list_box_description = "productListing-data-description-even"; // $extra_row=0; // } else { // $list_box_description = "productListing-data-description-odd"; // $extra_row=1; // } // $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"', // 'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)); //} // Following code will be executed only if Column Layout (Grid Layout) option is chosen if ($product_listing_layout_style == 'columns') { $lc_text = implode('<br />', $product_contents); $list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => $lc_text); $column ++; if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) { $column = 0; $rows ++; } } // End of Code fragment for Column Layout (Grid Layout) option in add on module $listing->MoveNext(); } $error_categories = false; } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); $error_categories = true; } if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) { $show_top_submit_button = true; } else { $show_top_submit_button = false; } if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) { $show_bottom_submit_button = true; } else { $show_bottom_submit_button = false; } if ($how_many > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0) { // bof: multiple products echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"'); } ?>

Thank you for helping me.

22 Oct 2012, 7:15 PM
#71
tiptop avatar

tiptop

New Zenner

Join Date:
Sep 2012
Posts:
6
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

..........................................................................................................................
AND THE ORIGINAL COPY FROM THE tpl_module_product_listing.php of the COLUMN GRID is :

<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $ * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING 04/04/2006 * Modified for admin control of customer option by Glenn Herbert (gjh42) 2012-09-21 & add grid sorter 2012-09-29 */ include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCT_LISTING)); ?> <div id="productListing"> <?php // only show when there is something to submit and enabled if ($show_top_submit_button == true) { ?> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?></div> <br class="clearBoth" /> <?php } // show top submit ?> <?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <div id="productsListingTopNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div> <div id="productsListingListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div> <br class="clearBoth" /> <?php } ?> <?php /** * load the list_box_content template to display the products */ if ($product_listing_layout_style == 'columns') { if (PRODUCT_LISTING_GRID_SORT) { echo '<ul id="gridSorter">' . PRODUCT_LISTING_GRID_SORT_TEXT; for ($col=0;$col<sizeof($grid_sort);$col++) { echo '<li class="item">' . $grid_sort[$col]['text'] . '</li>'; } echo '</ul>'; } require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php'); } else {// (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_tabular_display.php'); } ?> <?php if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <div id="productsListingBottomNumber" class="navSplitPagesResult back"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div> <div id="productsListingListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div> <br class="clearBoth" /> <?php } ?> <?php // only show when there is something to submit and enabled if ($show_bottom_submit_button == true) { ?> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit2" name="submit1"'); ?></div> <br class="clearBoth" /> <?php } // show_bottom_submit_button ?> </div> <?php // if ($show_top_submit_button == true or $show_bottom_submit_button == true or (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0)) { if ($show_top_submit_button == true or $show_bottom_submit_button == true) { ?> </form> <?php } ?>

Thank you for helping me.

25 Oct 2012, 8:28 AM
#72
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Set number of products displayed per page (support thread)

I don't see anything in tpl_modules_product_listing.php that looks out of place (assuming that you copied the "set number" code properly).

Something I neglected to ask before: what do you have in your /cache/ folder for myDebug log files? Post the latest one. This should tell what file and line the error is in.

25 Oct 2012, 9:56 AM
#73
tiptop avatar

tiptop

New Zenner

Join Date:
Sep 2012
Posts:
6
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Thank you gjh42,I appreciate your help.Below is the latest one I have in the cache folder and there are so many of this particular file generated between 16th and 18th of october,I am sure hundreds of this same file was generated in the cache folder during this period.I pray it will lead to my solution,thank you so much

Please one last question on the cache folder,I seem to have about 9998 files in this folder with a very large percentage of it occuring between october 16th and 18th 2012,is this normal?

[18-Oct-2012 11:48:33] PHP Warning: require_once(/home/spatm/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/spatm/public_html/includes/init_includes/init_ricjloader.php on line 12
[18-Oct-2012 11:48:33] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/spatm/public_html/plugins/riCjLoader/RiCjLoaderPlugin.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/spatm/public_html/includes/init_includes/init_ricjloader.php on line 12

25 Oct 2012, 2:22 PM
#74
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Set number of products displayed per page (support thread)

That debug log refers to a CSS/JS loader mod (RiCjLoaderPlugin.php) which you apparently tried to install on the 16th or so. I think you may have filled the cache to capacity with those, so that new logs are discarded. Try emptying the cache of debug logs (there are a few other files in there that you do not want to delete), open your site again and see what you get for new debug logs.

6 Nov 2012, 11:55 AM
#75
tiptop avatar

tiptop

New Zenner

Join Date:
Sep 2012
Posts:
6
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Thank you so much gjh42,I cannot thank you enough.you pointed me to the right direction,it was the cjloader module I installed that caused the whole problem and many errors were written in the cache folder,I try to delete the files but they were just so many i had over 9000 files in that short time,so I got tired of deleting and restored my site from a back up I did on the 15th of october before installing the cjloader.That solved the problem and well I have my site back I am not sure I want to reinstall the cjloader yet,am just glad I have my site back.Thank you and I will really watch out for how my installations are done to prevent complicated errors like the last one.Thank you once again.

23 Nov 2012, 6:51 PM
#76
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

I am have a problem with adding this addon. When I add the files and the inserts, I get a 500 error and the website store will not come up. I tried without the inserts and still the same error. Checked the error log and the it is showing the last (includes/classes/db/mysql/query_factory.php on line 120-(error msg)). I am installing on 1.51 with several addons. The minute I take off this addon my store returns to normal. Any suggestions.

23 Nov 2012, 10:13 PM
#77
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Set number of products displayed per page (support thread)

Exactly what other addons do you have? There may be some interferences. If two mods alter the same file, they need to be merged for both to operate. Replacing a custom file from one mod with a file from another mod may eliminate some code that is essential for PHP processing.

Seeing the site live may help us advise.

24 Nov 2012, 1:20 AM
#78
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

There is nothing added to either the module product_listing file or the template/modules_product_listing file.
The only addon that has been added to those 2 files is: column layout grid 2.3.1.
My other addons are dealing with admin, shipping, template alteration, and product_info but none dealt with either of these files.

24 Nov 2012, 1:34 AM
#79
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Set number of products displayed per page (support thread)

What files are in the "set number" mod package? If you have Column Grid installed, this mod most likely needs to alter one or more of the same files, which would cause problems.

24 Nov 2012, 8:00 AM
#80
mhawkins avatar

mhawkins

New Zenner

Join Date:
Jun 2009
Location:
Lynnwood, WA, USA
Posts:
40
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

files are in the "set number" mod package? If you have Column Grid installed, this mod most likely needs to alter one or more of the same files, which would cause problems.

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.

I took off set_num_products under functions/extra functions and the website comes up and the addon is working for now. Not sure if this is a good fix or will problems arise after disabling the one file.