Page 1 of 1

[solved] Products Hierarchy Drill Down Menu

Posted: Thu Aug 19, 2010 5:41 pm
by alexbuckland
Heres my system info:

CMS Version
1.8.1

Installed Modules
CGExtensions
1.19.2
CGSimpleSmarty
1.4.5
Products
2.8.3
CGEcommerceBase
1.2.2
Cart
1.7.2

PHP Information:
Current PHP Version (phpversion):
5.2.13
md5 function (md5_function):
On (True)
GD version (gd_version):
2
tempnam function (tempnam_function):
On (True)
Magic quotes in runtime (magic_quotes_runtime):
Off (False)
Is E_STRICT disabled in error_reporting (E_STRICT):

PHP Effective Memory Limit (memory_limit):
64M
Maximum Execution Time (max_execution_time):
30
PHP output_buffering (output_buffering):
4096
PHP Safe Mode (safe_mode):
Off (False)
File uploads (file_uploads):
On (True)
Maximum Post Size (post_max_size):
8M
Maximum Upload Size (upload_max_filesize):
10M
Session Save Path (session_save_path):
No check because open basedir active
Sessions are allowed to use Cookies (session_use_cookies):
On (True)
Basic XML (expat) support (xml_function):
On (True)
Checking if the httpd process can create a file inside of a directory it created (create_dir_and_file):

fsockopen: Connection ok!  
fopen: Connection ok!
Test ini_set (check_ini_set):
On (True)
Server Information:
Server API (server_api):
apache2handler
Server Database (server_db_type):
MySQL (mysql)
Server Database Version (server_db_version):
5.0.45
Server Software (server_software):
Apache/2.2.3 (CentOS)
Server Operating System (server_os):
Linux 2.6.9-023stab048.6-enterprise On i686


AND now the problem...

We have Products module set to {Products action="hierarchy"}
which displays a list of all the root level hierarchy items. For example like this:

1.
2.
3.
4.

What we want to do is then click on those hierarchy items to drill down into their children. Then click on the children to display the products in that childs level. For example:

Click on 1. and you get shown
1.1
1.2
1.3
1.4

Click on 2. and you get

2.1
2.2
2.3
2.4

Then I want to be able to click on 1.1 and be shown all the products that are in that level or if there are any further children, display them too.

Any help or pointers on this would be greatly appreciated. Seems like such a basic feature of product hierarchy but doesnt seem to work. Weve tried using this {Products hierarchy='trucks*'} with the default action aswell but that doesnt seem to work either...


HELP! ???

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Fri Aug 20, 2010 9:14 pm
by ridelikeaturtle
1) how was this solved?
2) has the Products module's usage changed in the latest release? Is this reflected in ANY documentation?  If so, where is it?  (Not in the module's "help" docs?)
3) does Products support {Products hierarchy='trucks'} at all anymore?

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Sat Aug 21, 2010 10:06 am
by howey
Hi

I am interested in this question as I have a very similar problem - how was the query soved?

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Sat Aug 21, 2010 11:52 am
by zaidcrowe
Hey guys,

I work with alex and we managed to make this work the way we wanted by moding the hierarchy report template:

Code: Select all

{if $item.node.count gt 0}

{else}

{/if}
It now works perfectly - and very flexibly  :)

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Wed Mar 30, 2011 11:08 am
by samlittle
Hi zaidcrowe and alexbuckland,

I'm looking to do this same thing.
Would you be willing to give me a little help with the hierarchy report template?

Thanks in advance!

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Wed Mar 30, 2011 11:33 am
by alexbuckland
Sure. Whats the problem you have?

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Wed Mar 30, 2011 12:07 pm
by samlittle
I'm trying to use the Hierarchy function of the products module to create a product navigation.

The problem I'm having is that the product doesn't show up under the "parent" hierarchy item, only the "sub" hierarchy. And, I'd like to make the "sub" items drop downs, instead of live all the time.

Here is a link to the site being developed.
http://faresharecoop.org/fsc-cms/index. ... hop-online


For instance, I need:

Deli (2)
Salads(0)
Soups(1)
Todays Special(1)

What I'm seeing is:

Deli (0)
Salads(0)
Soups(1)
Todays Special(1)

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Wed Mar 30, 2011 8:49 pm
by alexbuckland
You should be able to use {$item.count} for that.

Paste your template in and lets see what you have already?

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Thu Mar 31, 2011 11:31 am
by samlittle

Code: Select all

{* hierarchy report template *}
{if !isset($hdepth) && isset($hierarchy_item)}
<h3>Hierarchy Data for {$hierarchy_item.name} ({$hierarchy_item.id})</h3>
{/if}

{if !isset($hdepth)}{assign var='hdepth' value='0'}{/if}
{*
 // create a nested set of unordered lists 
 // if the active_hierarchy smarty variable exists
 // and matches the current hierarchy id
 // the active class will be given
 // to the ul.  You may want to modify your summary template
 // to set this variable
*}
<ul class="products_hierarchy_level{$hdepth}">
{foreach from=$hierdata key='key' item='item'}
{strip}
  <li {if isset($active_hierarchy) and $item.id == $active_hierarchy} class="active"{/if}>
  {if $item.count gt 0}
     <a href="{$item.url}">{$item.name} ({$item.count})</a>
  {else}
     {$item.name} ({$item.count})
  {/if}
  
  {if isset($item.children) }
    {* there are children call this template again *}
    {include file=$smarty.template hierdata=$item.children hdepth=$hdepth+1}
  {/if}
  
  </li>
{/strip}
{/foreach}
</ul>

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Mon Apr 04, 2011 9:03 am
by velvet_grooves
Was trying to sort this problem out for a long long while, and since resorted to just using a menu system with categories for each product page. Long winded but it works.

Cheers Zaid/Alex :)

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Tue Apr 05, 2011 11:35 am
by samlittle
Zaid/Alex-
Is your solution automated?

So that when a user adds/deletes a category there is a new menu item/page created/removed?

Re: [solved] Products Hierarchy Drill Down Menu

Posted: Sun Feb 16, 2014 2:38 am
by inyerface
samlittle, what was your solution?