[ic] Re: Subcategories

Dog Tags interchange-users@interchange.redhat.com
Tue Mar 5 10:15:01 2002


Hi All

I found an article by Mike Heins about his Tree Example in which deeper subcategories are created and displayed on the tree page. 

Here is a link to the full code for those who would like it:

http://developer.akopia.com/archive/interchange-users/2001/msg09061.html

I have a few questions:

1. In the Prerequisites section, Mike mentions that you can populate the new field with the following code. Where does the code go?
============
* You can populate it from prod_group and category with this code:

    [flag type=write table=products]
    [perl tables=products]
	my $db = $Db{products};
	my $ary = $db->query('select sku,prod_group,category from products');
	my $out = '';
	foreach $row ( @$ary) {
	    my ($sku, $pg, $cat) = @$row;
	    $db->set_field($sku, 'comb_category', "$pg:$cat")
		and $out .= "$sku = $pg:$cat<br>\n";
	}
	return $out;
    [/perl]
==============

2. Can the tree code be used to create deeper subcats that could be displayed at the tops of the respective subcatgory pages, as well as on the tree page?

One of my holy grails is to create a system that can handle deeper subcats, like 5-6 deep or more, and display them for navigational purposes. I have to admit that I'm totally struggling with this. I don't have a clue where to start. Mike mentions toward the end of his note that:

"If you did this on foundation or some other catalog with only two-level categories, try editing the comb_category field to add a third category in one of the products. I changed the comb_category field in os28074 to read "Hand Tools:Hammers:Mallets" to test the example."

This encourages me that deeper subcats are possible. Has anyone created a system that can handle deeper subcats?

Thanks very much.
-- 

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup