Osclass Support Forums

Osclass theme support => Zara Osclass Responsive Theme => Topic started by: zovi on February 20, 2018, 11:44:09 PM

Title: How do I hide/remove empty sub-categories on main page?
Post by: zovi on February 20, 2018, 11:44:09 PM
Hi
How do I hide/remove empty subcategories on main page? Just show sub-categories with one or more adds.

Of course, all subcategories should be displayed when creating an new ad.

Can somebody tell me how to do that?

Thanks in advance.
Title: Re: How do I hide/remove empty sub-categories on main page?
Post by: MB Themes on February 21, 2018, 08:38:34 AM
@zovi
You can put condition there in file:
oc-content/themes/zara/inc.category.php

Find:
Code: [Select]
                  <div class="link-wrap">
                    <a href="<?php echo osc_search_url($search_params); ?>" <?php echo ($s['pk_i_id'] == $search_cat_id 'class="bold"' ''); ?>>
                      <?php echo $s['s_name'] . ' <strong>' $s['i_num_items'] . '</strong>'?>
                    </a>
                  </div>

Replace with:
Code: [Select]
                  <?php if($s['i_num_items'] > 0) { ?>
                  <div class="link-wrap">
                    <a href="<?php echo osc_search_url($search_params); ?>" <?php echo ($s['pk_i_id'] == $search_cat_id 'class="bold"' ''); ?>>
                      <?php echo $s['s_name'] . ' <strong>' $s['i_num_items'] . '</strong>'?>
                    </a>
                  </div>
                <?php ?>
                <?php ?>
Title: Re: How do I hide/remove empty sub-categories on main page?
Post by: zovi on February 21, 2018, 09:35:52 AM
Hello my Hero  ;)
Works perfectly! Thanks a lot.

Great support!

You can mark this Topic as Solved. I can't find where I can do it by myself.

Have a nice Day
Zovi