Get Hierarchy Info from CMSMS Products

In CMSMS Official Boards there are many questions about Products module like "How can i show current Hierarchy name on my page?", "How can i give active class to parent hierarchy or different class then child Hierarchy?", "How can i show title of parent Hierarchy in summary view?" and probably some more.

Answer to all the questions is a single line of code in your Products Detail or Summary Template.

{assign var='get_hierarchy_info' value=$Products->GetHierarchyInfo($entry->hierarchy_id)}

So what can you do with above code?

Using print_r on above assigned variable $get_hierarchy_info you can see following info.

<pre>{$get_hierarchy_info|@print_r}</pre>
Array
(
    [id] => 4
    [name] => Current Hierarchy
    [parent_id] => 1
    [hierarchy] => 00001.00009
    [image] =>
    [long_name] => Parent Hierarchy | Current Hierarchy
    [description] =>
    [extra1] =>
    [extra2] =>
)

As you can see now you have all Hierarchy options available in your Detail Template.
You can read a detailed post on Arvixe Blog.

Comments