Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Oct 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: estorenow template: Category Counts Not Show

    Quote Originally Posted by gjh42 View Post
    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
    ///////////////////////////////////////////////////////////////////////////////////////////

  2. #12
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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>'

  3. #13
    Join Date
    Oct 2010
    Posts
    26
    Plugin Contributions
    0

    Default Re: estorenow template: Category Counts Not Show

    Quote Originally Posted by wokaozabuxing View Post
    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!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v150 Add category counts to main pages? Not just side menu?
    By mcqueeneycoins in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Jun 2012, 11:57 PM
  2. v139h EstoreNow Template - Right Side Column not appear
    By cwl3683 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 12 Apr 2012, 11:45 PM
  3. Show Category Counts
    By vincemaverick in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Sep 2008, 11:28 AM
  4. CSS Flyout Category Menu Show Counts
    By lloyd_borrett in forum Addon Sideboxes
    Replies: 1
    Last Post: 2 Feb 2008, 05:12 PM
  5. Replies: 1
    Last Post: 3 Jul 2007, 04:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR