Guest Posted February 27, 2014 Posted February 27, 2014 Where are the settings to set the number of products on each category page? Here is an example: http://www.womensbusinessclub.co.uk/index.php?cPath=21 It is only showing 3 products but there are more than 3
drferrari Posted February 27, 2014 Posted February 27, 2014 index.php search for (Line 100 - 170) after: if (isset($cPath) && strpos('_', $cPath)) { }else{ $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.categories_status, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and c.categories_status = 1 and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); and see if you have limit in end of query
Guest Posted February 27, 2014 Posted February 27, 2014 @@drferrari This is what I have - can you spot any limitations? if (isset($cPath) && strpos('_', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i=0, $n=sizeof($category_links); $i<$n; $i++) { $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); $categories = tep_db_fetch_array($categories_query); if ($categories['total'] < 1) { // do nothing, go through the loop } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); break; // we've found the deepest category the customer is in } } } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '"></a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } }
♥mattjt83 Posted February 27, 2014 Posted February 27, 2014 @@womensbusinessclub Try looking in includes/modules/product_listing.php for something like: $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); Matt
drferrari Posted February 27, 2014 Posted February 27, 2014 change this: while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '"></a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } to this: while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo '<td align="center" width="' . $width . '" valign="top"> <table border="0" width="100%" cellspacing="4" cellpadding="4"> <tr> <td width="100%" align="center"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '"> ' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a></td> </tr> <tr> <td width="100%" align="center"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'. $categories['categories_name'].'</a></td> </tr> </table> </td>'; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } }
Guest Posted February 27, 2014 Posted February 27, 2014 @@drferrari all that that does is put the subcategories image in place which I have removed as I don't want it there. The actual number of items listed remains 3 using the new code
Guest Posted February 27, 2014 Posted February 27, 2014 @@mattjt83 I found MAX_DISPLAY_SEARCH_RESULTS and changed it for a number to test but it didn't do anything
♥14steve14 Posted February 27, 2014 Posted February 27, 2014 Have a look in your admin area. Go to admin - configuration - maximum values and change a setting there. I just cannot remember which one it is. REMEMBER BACKUP, BACKUP AND BACKUP
Guest Posted February 27, 2014 Posted February 27, 2014 @@14steve14 Yes I have played around with this but it didn't make a difference
Recommended Posts
Archived
This topic is now archived and is closed to further replies.