Author Topic: Hide empty categories  (Read 385 times)

goldlink

  • Beginner
  • *
  • Posts: 11
    • Erotica Sexy Shop
Hide empty categories
« on: June 01, 2018, 18:46:44 pm »
Hi, I've been trying for some time to make a change in the management system categories that I think could be implemented by default on VM, because it's very useful in several cases. I've a site with 8 main categories but each category has about 70/80 categories under it; understand well how difficult and dispersed the consultation by users, as there are many very often empty categories. It would therefore be a good thing not to show the categories that do not present articles within them.

What do you think? I was trying to make a change starting from the layout file of the categories, but it also arose the problem of always showing the 8 main categories (even if they do not present articles but only other categories).

Do you have any advice to give?

Thank you very much, I hope I have asked an interesting and non-trivial question.

Joomla 3.8.6
Virtuemart 3.2.4

goldlink.

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1331
Re: Hide empty categories
« Reply #1 on: June 04, 2018, 11:59:58 am »
Not sure if you are willing to spend a few bucks on that, but it's a feature that can be found in filtering extensions like Custom Filters.
https://breakdesigns.net/extensions/joomla/custom-filters

goldlink

  • Beginner
  • *
  • Posts: 11
    • Erotica Sexy Shop
Re: Hide empty categories
« Reply #2 on: June 04, 2018, 15:23:55 pm »
Thans balai, it would not be a problem to spend something, I immediately take a look!

But I was thinking of finding someone to create something to implement maybe in the next updates of vurtuemart...

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3332
  • using Matomo instead of Google Analytics
Re: Hide empty categories
« Reply #3 on: June 04, 2018, 21:57:22 pm »
Why don't you simply unpublish empty subcategories?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

goldlink

  • Beginner
  • *
  • Posts: 11
    • Erotica Sexy Shop
Re: Hide empty categories
« Reply #4 on: June 04, 2018, 23:39:01 pm »
It's not very practical, I've about 70/80 sub-categories for each main-category and I can't manually manage the unpublish every time a category becomes empty and this happens often...  :-\

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1331
Re: Hide empty categories
« Reply #5 on: June 05, 2018, 11:24:00 am »
I don't think that a change that you will made will be easily implemented in the next updates.
Anyway the decision is yours.

goldlink

  • Beginner
  • *
  • Posts: 11
    • Erotica Sexy Shop
Re: Hide empty categories
« Reply #6 on: June 05, 2018, 11:57:21 am »
Thanks balai, I will try to find a solution, at the end show an empty category is never a beautiful thing, much less a large number of empty categories...
..if there will be updates I will post them, thanks again ;)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3241
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Hide empty categories
« Reply #7 on: June 05, 2018, 15:57:44 pm »
Problem is to hide subcategories, you have to count all products in subcategories and check if any category have valid product.
But Virtuemart hide/display by config product without stock, unpublished(and certainly other cases)
Some custom plugin can hide products too
If you have many products, this can be very expensive query to check for this.