Advertisement:

Author Topic: [SOLVED] How can I add the item count on "Refine by category" colum?  (Read 897 times)

cwkeng09

  • Newbie
  • *
  • Posts: 7
How can I add the item count on "Refine by category" colum?

Please help.
« Last Edit: July 19, 2016, 07:30:08 pm by cwkeng09 »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How can I add the item count on "Refine by category" colum?
« Reply #1 on: July 19, 2016, 01:28:01 pm »
Hi,

What theme are you using?

Regards

cwkeng09

  • Newbie
  • *
  • Posts: 7
Re: How can I add the item count on "Refine by category" colum?
« Reply #2 on: July 19, 2016, 03:19:09 pm »
Hi,

What theme are you using?

Regards

i'm using bender.

thank

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How can I add the item count on "Refine by category" colum?
« Reply #3 on: July 19, 2016, 03:36:27 pm »
Find this block in bender/functions.php:

Code: [Select]
        foreach($c as $key => $value) {
    ?>
            <li>
                <a id="cat_<?php echo osc_esc_html($value['pk_i_id']);?>" href="<?php echo osc_esc_html(osc_update_search_url(array('sCategory'=> $value['pk_i_id'], 'iPage'=>null))); ?>">
                <?php if(isset($current_category) && $current_category == $value['pk_i_id']){ echo '<strong>'.$value['s_name'].'</strong>'; }
                else{ echo 
$value['s_name']; } ?>

                </a>

            </li>
    <?php
        
}

Replace with:

Code: [Select]
        foreach($c as $key => $value) {
    ?>
            <li>
                <a id="cat_<?php echo osc_esc_html($value['pk_i_id']);?>" href="<?php echo osc_esc_html(osc_update_search_url(array('sCategory'=> $value['pk_i_id'], 'iPage'=>null))); ?>">
                <?php if(isset($current_category) && $current_category == $value['pk_i_id']){ echo '<strong>'.$value['s_name'] . ' (' $value['i_num_items'] . ')</strong>'; }
                else{ echo 
$value['s_name'] . ' (' $value['i_num_items'] . ')'; } ?>

                </a>

            </li>
    <?php
        
}

Regards
« Last Edit: July 19, 2016, 04:22:25 pm by teseo »

cwkeng09

  • Newbie
  • *
  • Posts: 7
Re: How can I add the item count on "Refine by category" colum?
« Reply #4 on: July 19, 2016, 04:49:02 pm »
Its work!!  ;)

thank you

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How can I add the item count on "Refine by category" colum?
« Reply #5 on: July 19, 2016, 04:50:45 pm »
You're welcome. :) Please add [SOLVED] to the title of this thread editing the first message.

Regards