LISE Category not showing associated Items

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
blackrain
Forum Members
Forum Members
Posts: 98
Joined: Wed Feb 20, 2008 4:33 pm

LISE Category not showing associated Items

Post by blackrain »

I am trying to get the LISE module to show a list of Categories and the nested items associated. ie.

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}
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: LISE Category not showing associated Items

Post by velden »

{$item.value} doesn't need the {} but that probably isn't the reason.
I think it should be $item->value btw.

Further: force_array=1 but you should not reference an array item with -> but with either a dot or square brackets.

{$product['title']} or {$product.title}

Not sure what you have printed with print_r but I'd have tried {$item|print_r} and {$product|print_r} for troubleshooting.

Disclaimer: I didn't test any of the above so I'm not 100% sure about the array thing in this context.
blackrain
Forum Members
Forum Members
Posts: 98
Joined: Wed Feb 20, 2008 4:33 pm

Re: LISE Category not showing associated Items

Post by blackrain »

@velden, Thanks for the reply.

I have made the changes but still the items do not display. I tried using the

Code: Select all

{$product->title|print_r}
on the product variable and it looks like the iteration is working even though no item details are displayed only 1s where the iterator has caught an item in the category.

So that leaves the mystery as to why the item details are not displaying even though they are clearly being counted.

i also tried $item->value but this broke it.

I am at a loss on this one

cheers
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: LISE Category not showing associated Items

Post by velden »

Any chance you should just use value=$item ?

$item->value probably breaks the thing because $item is not an object but just an integer value.
Locked

Return to “Modules/Add-Ons”