[solved] Products Hierarchy Drill Down Menu

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
alexbuckland

[solved] Products Hierarchy Drill Down Menu

Post 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! ???
Last edited by alexbuckland on Fri Aug 20, 2010 11:45 am, edited 1 time in total.
ridelikeaturtle
Forum Members
Forum Members
Posts: 103
Joined: Thu May 06, 2010 9:22 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post 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?
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post by howey »

Hi

I am interested in this question as I have a very similar problem - how was the query soved?
zaidcrowe
Forum Members
Forum Members
Posts: 109
Joined: Wed Jun 10, 2009 3:43 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post 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  :)
samlittle
New Member
New Member
Posts: 6
Joined: Tue Mar 29, 2011 1:06 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post 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!
alexbuckland

Re: [solved] Products Hierarchy Drill Down Menu

Post by alexbuckland »

Sure. Whats the problem you have?
samlittle
New Member
New Member
Posts: 6
Joined: Tue Mar 29, 2011 1:06 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post 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)
alexbuckland

Re: [solved] Products Hierarchy Drill Down Menu

Post by alexbuckland »

You should be able to use {$item.count} for that.

Paste your template in and lets see what you have already?
samlittle
New Member
New Member
Posts: 6
Joined: Tue Mar 29, 2011 1:06 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post 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>
velvet_grooves
Forum Members
Forum Members
Posts: 54
Joined: Mon Oct 18, 2010 1:33 am

Re: [solved] Products Hierarchy Drill Down Menu

Post 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 :)
samlittle
New Member
New Member
Posts: 6
Joined: Tue Mar 29, 2011 1:06 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post 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?
inyerface
Forum Members
Forum Members
Posts: 191
Joined: Mon Nov 26, 2007 4:46 pm

Re: [solved] Products Hierarchy Drill Down Menu

Post by inyerface »

samlittle, what was your solution?
Locked

Return to “Modules/Add-Ons”