estorenow template: Category Counts Not Show
you can see from my site that there is no products' quantity dispaly in the left side "category box" although I've turned "Show Category Counts" into "true"...May I know what's the matter? And how to fix it? Thanks very much!
my site www.letovn.com
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
wokaozabuxing
you can see from my site that there is no products' quantity dispaly in the left side "category box" although I've turned "Show Category Counts" into "true"...May I know what's the matter? And how to fix it? Thanks very much!
my site
www.letovn.com
Hi ,
We do changed the defalult category sidebox, and disabled the product count.
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
blingthemes
Hi ,
We do changed the defalult category sidebox, and disabled the product count.
but can you let me know how to change it back? I do need the product count. Thank you very much!
Re: estorenow template: Category Counts Not Show
If you are developing a Zen Cart template and want a stock admin-editable feature disabled, it is always best to use a SQL patch if feasible and leave the admin switch functional.
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
gjh42
If you are developing a Zen Cart template and want a stock admin-editable feature disabled, it is always best to use a SQL patch if feasible and leave the admin switch functional.
sorry but what do you mean? Pls just let me what I can do if I want my site to show the product counts in the category box. Tks!
Re: estorenow template: Category Counts Not Show
Glenn was addressing the template designer.
I can say that the first thing I do when creating a Zencart site is turn that 'feature' off.
You would have to find the file the template designer modified to remove the counts.
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
stevesh
Glenn was addressing the template designer.
I can say that the first thing I do when creating a Zencart site is turn that 'feature' off.
You would have to find the file the template designer modified to remove the counts.
Tks! Stevesh.
But it seems difficult for me to find the file the template designer modified to remove the counts. Can you suggest me which file it might be and where it is? Thank you very much for your help! Stevesh.
Re: estorenow template: Category Counts Not Show
It's really hard to say. Look through the files provided with the template and look for one with 'categories' in the file name.
You might also contact the template designers.
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
stevesh
It's really hard to say. Look through the files provided with the template and look for one with 'categories' in the file name.
You might also contact the template designers.
Anyway, thank you very much for your great help now and before.
Have a nice day!
Re: estorenow template: Category Counts Not Show
The file would probably be /includes/templates/your_template/sideboxes/tpl_categories.php.
Compare it to /includes/templates/template_default/sideboxes/tpl_categories.php to find the differences.
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
gjh42
The file would probably be /includes/templates/your_template/sideboxes/tpl_categories.php.
Compare it to /includes/templates/template_default/sideboxes/tpl_categories.php to find the differences.
Thank you gjh42. Yes, you're right. I've changed sth, and what it looks like pls see my site www.letovn.com for reference. But it's not in the line of the category name. May I know what I should modify next? Pls see the following code for reference. Tks!!
Code:
/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2006 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_categories.php 4162 2006-08-17 03:55:02Z ajeh $
*/
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent"><ul id="cat">' ;
$ul_close='YES';//YES NO
for ($i=0;$i<sizeof($box_categories_array);$i++) {
switch(true) {
// to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
// uncomment the select below and set the cPath=3 to the cPath= your_categories_id
// many variations of this can be done
// case ($box_categories_array[$i]['path'] == 'cPath=3'):
// $new_style = 'category-holiday';
// break;
case ($box_categories_array[$i]['top'] == 'true'):
$new_style = 'category-top';
break;
case ($box_categories_array[$i]['has_sub_cat']):
$new_style = 'category-subs';
break;
default:
$new_style = 'category-products';
}
if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
/////////////////////////////1.1/////////////////////////
if($box_categories_array[$i]['has_sub_cat'] && $new_style == 'category-top' ){
if($ul_close=='NO'){
$content =$content.'</ul></li>';
$ul_close='YES';
}
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
$content .= $box_categories_array[$i]['name'];
$content =$content.'</a><ul>';
}//new addon for <li>
/////////////////1.2///////////////////////////////
elseif($box_categories_array[$i]['has_sub_cat']==false && $new_style == 'category-products'){// for child
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
$content .= $box_categories_array[$i]['name'];
$content =$content.'</a></li>';
if($i==(sizeof($box_categories_array)-1)){ //last li ele
$content =$content.'</ul></li>';
}
//////////////////1.3/////////////////
elseif($box_categories_array[$i]['has_sub_cat']==false&&$new_style == 'category-top'){
if($ul_close=='NO'){
$content =$content.'</ul></li>';
$ul_close='YES';
}
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
$content .= $box_categories_array[$i]['name'];
$content =$content.'</a></li>';
}
////////////////////////////
if (SHOW_COUNTS == 'true') {
if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
$content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
}
}
}//eof new adds on
}//end of else
}//eof for loop
///////////////////////////////////////////////////////////////////////////////////////////
Re: estorenow template: Category Counts Not Show
The custom file has added code to make <ul><li> lists, so the standard location for the counts will not work. Probably the easiest way to fix this is to move the code
PHP Code:
if (SHOW_COUNTS == 'true') {
if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
$content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
}
}
from where you show it to each place where <li> elements are closed. Replace this in two places
$content =$content.'</a></li>';
with this
PHP Code:
$content =$content.'</a>';
if (SHOW_COUNTS == 'true') {
if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
$content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
}
}
$content =$content.'</li>';
Re: estorenow template: Category Counts Not Show
Quote:
Originally Posted by
wokaozabuxing
Thank you gjh42. Yes, you're right. I've changed sth, and what it looks like pls see my site
www.letovn.com for reference. But it's not in the line of the category name. May I know what I should modify next? Pls see the following code for reference. Tks!!
Code:
/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2006 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_categories.php 4162 2006-08-17 03:55:02Z ajeh $
*/
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent"><ul id="cat">' ;
$ul_close='YES';//YES NO
for ($i=0;$i<sizeof($box_categories_array);$i++) {
switch(true) {
// to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
// uncomment the select below and set the cPath=3 to the cPath= your_categories_id
// many variations of this can be done
// case ($box_categories_array[$i]['path'] == 'cPath=3'):
// $new_style = 'category-holiday';
// break;
case ($box_categories_array[$i]['top'] == 'true'):
$new_style = 'category-top';
break;
case ($box_categories_array[$i]['has_sub_cat']):
$new_style = 'category-subs';
break;
default:
$new_style = 'category-products';
}
if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
/////////////////////////////1.1/////////////////////////
if($box_categories_array[$i]['has_sub_cat'] && $new_style == 'category-top' ){
if($ul_close=='NO'){
$content =$content.'</ul></li>';
$ul_close='YES';
}
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
$content .= $box_categories_array[$i]['name'];
$content =$content.'</a><ul>';
}//new addon for <li>
/////////////////1.2///////////////////////////////
elseif($box_categories_array[$i]['has_sub_cat']==false && $new_style == 'category-products'){// for child
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
$content .= $box_categories_array[$i]['name'];
$content =$content.'</a></li>';
if($i==(sizeof($box_categories_array)-1)){ //last li ele
$content =$content.'</ul></li>';
}
//////////////////1.3/////////////////
elseif($box_categories_array[$i]['has_sub_cat']==false&&$new_style == 'category-top'){
if($ul_close=='NO'){
$content =$content.'</ul></li>';
$ul_close='YES';
}
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
$content .= $box_categories_array[$i]['name'];
$content =$content.'</a></li>';
}
////////////////////////////
if (SHOW_COUNTS == 'true') {
if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
$content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
}
}
}//eof new adds on
}//end of else
}//eof for loop
///////////////////////////////////////////////////////////////////////////////////////////
Hi there I was wondering if you could post your php that you updated, I am having the same issue with my site and I see your site is now working correctly...I would greatly appreciate it!