Page 1 of 1

display a category if it is not empty

Posted: Wed Apr 27, 2011 1:36 am
by keyframerlino
Hi. I have a form that is connected and save the data into the database. The form contains a category and subcategory on each main category.
What I want to achieve is for example I have 10 main category and only 7 main category has a product on each subcategory, I want the 3 main category that is empty including each subcategory to hide it. And then when a user add a product in the category that is empty it will automatically displayed in the list item that is shown to the viewers. This means that the 7 categories displayed as a list item will become 8 categories.
Is it possible?

Lino

Re: display a category if it is not empty

Posted: Wed Apr 27, 2011 12:50 pm
by pickle
This is not General Discussion. Moved to PHP Theory

Re: display a category if it is not empty

Posted: Fri Apr 29, 2011 1:49 am
by eivind
It's possible for sure, but how you should code it probably differs according to how your data looks like. Could you give an example of how the data source would look like?