*

zovi

  • ***
  • 29 posts
How do I hide/remove empty sub-categories on main page?
« 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.
« Last Edit: February 20, 2018, 11:47:20 pm by zovi »

Marked as best answer by zovi on February 21, 2018, 09:36:03 am
*

MB Themes

Re: How do I hide/remove empty sub-categories on main page?
« Reply #1 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 } ?>

  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • ***
  • 29 posts
Re: How do I hide/remove empty sub-categories on main page?
« Reply #2 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
« Last Edit: February 21, 2018, 09:41:15 am by zovi »