Forums / Addon Templates / estorenow template: Category Counts Not Show

estorenow template: Category Counts Not Show

Locked

Views: 3,901

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
14 Oct 2010, 4:01 AM
#1
wokaozabuxing avatar

wokaozabuxing

New Zenner

Join Date:
Oct 2010
Posts:
10
Plugin Contributions:
0

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 https://www.letovn.com

14 Oct 2010, 7:18 AM
#2
blingthemes avatar

blingthemes

New Zenner

Join Date:
Aug 2010
Posts:
20
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

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 https://www.letovn.com

Hi ,
We do changed the defalult category sidebox, and disabled the product count.

Blingthemes
Blingthemes Beauty your zencart Store.

14 Oct 2010, 12:31 PM
#3
wokaozabuxing avatar

wokaozabuxing

New Zenner

Join Date:
Oct 2010
Posts:
10
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

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!

14 Oct 2010, 12:53 PM
#4
gjh42 avatar

gjh42

Black Belt

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

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.

14 Oct 2010, 2:22 PM
#5
wokaozabuxing avatar

wokaozabuxing

New Zenner

Join Date:
Oct 2010
Posts:
10
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

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!

14 Oct 2010, 2:29 PM
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

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.

14 Oct 2010, 3:38 PM
#7
wokaozabuxing avatar

wokaozabuxing

New Zenner

Join Date:
Oct 2010
Posts:
10
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

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.

14 Oct 2010, 3:50 PM
#8
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

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.

14 Oct 2010, 4:00 PM
#9
wokaozabuxing avatar

wokaozabuxing

New Zenner

Join Date:
Oct 2010
Posts:
10
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

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!

14 Oct 2010, 9:35 PM
#10
gjh42 avatar

gjh42

Black Belt

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

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.

15 Oct 2010, 10:31 AM
#11
wokaozabuxing avatar

wokaozabuxing

New Zenner

Join Date:
Oct 2010
Posts:
10
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

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 https://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!!

/**
 * 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
///////////////////////////////////////////////////////////////////////////////////////////
19 Oct 2010, 3:42 PM
#12
gjh42 avatar

gjh42

Black Belt

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

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
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.'</a></li>';

with this ```php
          $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>';
27 Oct 2010, 4:51 AM
#13
trice avatar

trice

New Zenner

Join Date:
Oct 2010
Posts:
26
Plugin Contributions:
0

Re: estorenow template: Category Counts Not Show

wokaozabuxing:

Thank you gjh42. Yes, you're right. I've changed sth, and what it looks like pls see my site https://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!!

/**

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