
Originally Posted by
satello
Hi everyone, long time since I retouched my heavily customized tableau. this morning i've installed the new one, over a 1.5.4 zencart, using old patched database.
before I go into extra custom work, just got this very odd problem. surely is just something in the settings I am missing...
Ok, in my old version (1.2) the main category page shows all the subcategories
http://www.londonsatman.co.uk/italian-satellite-tv-77/
with the same settings, but on the latest version of the template, the category main page show all the products present in the subcategories
http://www.londonsatman.co.uk/zencar...index&cPath=77
I would like the main category page to show subcategories, and also a small thumb for it. I remember when I tried to update a few months ago this was the result but as I was very busy I've abandoned the upgrade, but can't manage to have it now
here are a few conf settings:
Layout Settings
Main Page - Opens with Category 0
Categories - Always Open to Show SubCategories 1
many thanks for your time in reading this.
This is caused by a change in the includes\modules\pages\index\main_template_vars.php file
To switch back to the old way first uncomment lines 64 THROUGH 123 and line 126.
Code:
/*$sql = "SELECT cd.categories_name, c.categories_image
FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE c.categories_id = :categoriesID
AND cd.categories_id = :categoriesID
AND cd.language_id = :languagesID
AND c.categories_status= '1'";
$sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer');
$sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer');
$category = $db->Execute($sql);
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++)
{
$sql = "SELECT count(*) AS total
FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE c.parent_id = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'";
$sql = $db->bindVars($sql, ':parentID', $category_links[$i], 'integer');
$sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer');
$categories = $db->Execute($sql);
if ($categories->fields['total'] < 1)
{
// do nothing, go through the loop
} else {
$categories_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 = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'
ORDER BY sort_order, cd.categories_name";
$categories_query = $db->bindVars($categories_query, ':parentID', $category_links[$i], 'integer');
$categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_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 = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'
ORDER BY sort_order, cd.categories_name";
$categories_query = $db->bindVars($categories_query, ':parentID', $current_category_id, 'integer');
$categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
}
$categories = $db->Execute($categories_query);
$number_of_categories = $categories->RecordCount();
$new_products_category_id = $current_category_id;*/
/////////////////////////////////////////////////////////////////////////////////////////////////////
//$tpl_page_body = 'tpl_index_categories.php';
/////////////////////////////////////////////////////////////////////////////////////////////////////
Next comment out this section (129-196):
Code:
//BOF SHOW ALL PRODUCTS FOR PARENT CATEGORIES
if (SHOW_PRODUCT_INFO_ALL_PRODUCTS == '1') {
// set a category filter
$new_products_category_id = $cPath;
} else {
// do not set the category
}
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
/* ,
'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
*/
asort($define_list);
reset($define_list);
$column_list = array();
foreach ($define_list as $key => $value)
{
if ($value > 0) $column_list[] = $key;
}
$select_column_list = '';
for ($i=0, $n=sizeof($column_list); $i<$n; $i++)
{
switch ($column_list[$i])
{
case 'PRODUCT_LIST_MODEL':
$select_column_list .= 'p.products_model, ';
break;
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, ';
break;
case 'PRODUCT_LIST_MANUFACTURER':
$select_column_list .= 'm.manufacturers_name, ';
break;
case 'PRODUCT_LIST_QUANTITY':
$select_column_list .= 'p.products_quantity, ';
break;
case 'PRODUCT_LIST_IMAGE':
$select_column_list .= 'p.products_image, ';
break;
case 'PRODUCT_LIST_WEIGHT':
$select_column_list .= 'p.products_weight, ';
break;
}
}
// always add quantity regardless of whether or not it is in the listing for add to cart buttons
if (PRODUCT_LIST_QUANTITY < 1) {
$select_column_list .= 'p.products_quantity, ';
}
// set the product filters according to selected product type
$typefilter = 'default';
if (isset($_GET['typefilter'])) $typefilter = $_GET['typefilter'];
require(zen_get_index_filters_directory($typefilter . '_filter.php'));
////////////////////////////////////////////////////////////////////////////////////////////////////////////
$tpl_page_body = 'tpl_index_product_list.php';
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//EOF SHOW ALL PRODUCTS FOR PARENT CATEGORIES
This will revert to sub-category photos showing when a parent category is selected.
Bookmarks