I am designing an EE site for a board game cafe which sells games online and also has a games library in-store for playing. The client wants to enter the game information only once into the shop database (games will be for sale online only, available in store only, or both). Initially, when I did the online shop coding for online sales (I'm using Expresso Store), I used the categories as navigation. I did this so that the client can easily add categories. The client wants the same categories available for the in-store games library, so I copied the entire Store template group for the games library and modified the product template to remove the pricing and ‘add to cart’ functionality, but I need different sidebar category navigation in this template group as not all games available online for sale are available in store. I made a new category group called ‘games library’ and was hoping that only products with that checked (id 10) will return the other categories.
I have sidebar navigation which looks (in part) like this:
<h2>Genres</h2>
{exp:gwcode_categories group_id="4" show_empty="no"}
<a href="{path=games_library/cat/{cat_url_title}}">{cat_name}</a>
{/exp:gwcode_categories}
<h2>Age Groups</h2>
{exp:gwcode_categories group_id="8" show_empty="no"}
<a href="{path=games_library/cat/{cat_url_title}}">{cat_name}</a>
{/exp:gwcode_categories}
I only want items to show up in this navigation if another category (ID 10) is also checked.
I tried this, but it doesn’t work – it just shows empty bullets
<h2>Genres</h2>
{exp:gwcode_categories group_id="4" show_empty="no"}
{if cat_group_id == '10' AND cat_group_id == '4'}
<a href="{path=games_library/cat/{cat_url_title}}">{cat_name}</a>
{/if}
{/exp:gwcode_categories}
Can anyone help?
cat_group_id == 241
and group_id == '4' are? I'm not sure they can be interchanged like that. As James mentioned categories can only belong to one group so can you confirm we're only pulling from one group? If so what group (name and ID) is this?