Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / sub-categories product count management

sub-categories product count management

Locked

Views: 900

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
23 Jul 2009, 4:53 PM
#1
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

sub-categories product count management

Hi,

I'm using v1.38.

I set the styling of my sub-categories to display: block;
But this causes the count of the products to go to the next line, is there a way to have it near the sub-category?

www.editricebahai.com/negozio_online

Thank you.

23 Jul 2009, 5:30 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: sub-categories product count management

You would need to modify tpl_categories.php to move the count inside the link instead of after it. Categories Dressing has already done this, so you could use it, or study its code to see how it was done if you want to recode for yourself.

24 Jul 2009, 1:23 PM
#3
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: sub-categories product count management

Thanks.

I tried, but most probably I didn't do it right, as the count disappeared.

Could you please point me more precisely?
And what is categories dressing?

I did it like this:

      if ($box_categories_array[$i]['has_sub_cat']) {
        $content .= CATEGORIES_SEPARATOR;
		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 .= '</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;
        //}
      //}

is that what I was supposed to do?

24 Jul 2009, 1:32 PM
#4
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: sub-categories product count management

I found Categories Dressing.
Meanwhile if you could please explain the coding anyway, I'd appreciate.

25 Jul 2009, 12:01 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: sub-categories product count management

Without going back and looking at the original file, your adjustment looks right. Not sure what happened, and am packing for a trip so don't have time to get into it for a couple of weeks.

25 Jul 2009, 8:51 AM
#6
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: sub-categories product count management

Ok, thanks, have a good trip.

I'll play around with it , in case I'll post an update request.