Help on using Products module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Help on using Products module

Post by Mich-adg »

Hi,
i'm trying to make a very simple thing with Products module : get the active hierarchy and category, not only in the Detail view but also in Summary view. Don't know if i don't understand this module mechanism but i can't get a simple solution to achieve it.

For example, if i have this hierarchy :
1 - Sport
a - soccer
b - basket
...
2 - Arts
a - painting
b - drawing
...

Now, i call this in one page : {Products action="hierarchy"}

If i click on "Sport", i get a summary list with "soccer", "basket" etc., but i can't get simply the active hierarchy name "Sport".
Same question if i call {Products action="categorylist"}, can't get the active category name.

After many researches on the web, i found that we can get these variables in the details views, but this is not a solution. We need these variables avaiables after the first hierarchy / category click.

Thanks for any help or explanation if i totally missed anything in the Products module use.
applejack
Power Poster
Power Poster
Posts: 1015
Joined: Fri Mar 30, 2007 2:28 am
Location: London

Re: Help on using Products module

Post by applejack »

In the summary template to get the Hierarchy you can use

{$entry->breadcrumb}

for the categories I think you will have to put them into their own loop.

In order to see what variables are available in a template in the foreach loop you can do


{foreach from=$items|@print_r item=entry}
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Re: Help on using Products module

Post by Mich-adg »

Hi, thks for the reply.

I tried to use breadcrumb in the summary template but it doesn't work.

For the moment, the best solution i found to get the active hierarchy in the summary template:

{assign var='get_hierarchy_info' value=$Products->GetHierarchyInfo($items[0]->hierarchy_id)}
<h1>{$get_hierarchy_info.name}</h1>

Now i must get the category name of item0 too.
Post Reply

Return to “Modules/Add-Ons”