Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   dont want to display empty category (/showthread.php?t=10941)

matzii September 3rd, 2014 11:09 AM

dont want to display empty category
 
dont want to display empty category

with the widget "categories"

the site are hotells dot se
and i dont want the "city with no hotel" to show in the list of cities!

Eric September 3rd, 2014 11:10 AM

Hi,

If your category has no products, you could set it to hidden and then it won't appear in the categories widget.

Eric

matzii September 3rd, 2014 11:18 AM

thanks for fast answer!

I dont want to do anything manually. Perhaps one year there are a hotell in a city and the next year there arent any hotel and i wold be great if its done automaticle whith the categories display only categories with content

matzii September 4th, 2014 09:57 AM

hi again!

are there anyway to solwe my last question?

Eric September 4th, 2014 10:01 AM

Hi,

The only way is to set it to hidden.

Eric

matzii September 4th, 2014 10:03 AM

manualy?

Eric September 4th, 2014 10:06 AM

Hi,

Yes, or you could hide categories based on product count. That will require changes to your "Categories" widgets.

To get the number of products in a specific category, you can use the PHP variable:

PHP Code:

$category->pc 

To get the total number of products in a category and its subcategories, you can use the PHP variable:

PHP Code:

$category->pct 

Then perform some conditional logic in your views to display or not display the categories.

Eric


All times are GMT -5. The time now is 12:54 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.