Category 1
Item 1
Item 3
Category 2
Item 2
Item 3
As you can see Items can belong to multiple Categories.
I have looked at a couple of posts that JoMorg has commented on but when I try the code suggested I can't seem to render the Item details but, I can see that the iterations are working as the print_r is returning data and if I add a character it will returns it the same amount of times as the items associated with each category.
I am wondering if the problem is that each item belongs to multiple categories. But again I have tested this theory and it still doesn't work as expected.
I have included the code below
Code: Select all
{foreach from=$categories item=category}
{if isset($category->category_id) && $category->items|count > 0}
<h4>{$category->name}</h4>
{foreach from=$category->items item=item}
{LISELoader item='item' identifier='item_id' force_array=1 instance='LISEproducts' value={$item.value} assign='product'}
{$product->title}
{/foreach}
{/if}
{/foreach}