avcbath Posted March 13, 2007 Share Posted March 13, 2007 I would like to separate the store into 3 sections like hardware, clothing, accessories with buttons across the top so that when the page is selected the left hand menu will be specific to the tab selected. ie hit the clothing button at the top and the left hand menu will read hats, scarfs, jumpers etc, select the accessories button and a different left hand menu will provide you with the options of bags, rings etc. I've not seen this form of navigation featured in any of the OS Commerce stores I've seen, so is it possible? Link to comment Share on other sites More sharing options...
jefs.42 Posted March 13, 2007 Share Posted March 13, 2007 Sure, though I only did a simple check to see... The main thing is that you need to adjust catalogs/includes/boxes/categories.php to start at a different top level. The default is a hard coded '0' (ie, the Top). So you could change that query (about line 73) to something like this (partial line): where c.parent_id='$toplevel' instead of c.parent_id='0' Then your top menu buttons would link to something like index.php?toplevel=21 where the 21 is the id of the category you want to use as the top leve. The main problem is that this new variable will need to be included in links and forms if you don't want it to revert back to the 'normal' category tree. One possiblity would be to modify the tep_href_link and tep_draw_form functions in includes/functions/html_output.php to append it to the end of links and form's action. Link to comment Share on other sites More sharing options...
avcbath Posted March 14, 2007 Author Share Posted March 14, 2007 The main problem is that this new variable will need to be included in links and forms if you don't want it to revert back to the 'normal' category tree. One possiblity would be to modify the tep_href_link and tep_draw_form functions in includes/functions/html_output.php to append it to the end of links and form's action. OK thanks for this, I'm starting on php, I follow the idea of the seperate menus per link as you describe but in simple terms what is the problem and result of what you describe above? Link to comment Share on other sites More sharing options...
jefs.42 Posted March 16, 2007 Share Posted March 16, 2007 it wouldn't technically cause any real problems. but say you went into one of the main categories from your top links. At that point the left hand categories box will only show the subcategories of that. The you click on something like say the "Shipping & Returns" link in the Information box. Since that link won't be passing on the $toplevel value, it becomes undefined or 0. So when you get to the shipping page, the categories tree will start from the very top level and would display all the categories including your main ones. And it'll stay that way until one of the upper links was clicked again to pass a new $toplevel value. Link to comment Share on other sites More sharing options...
jefs.42 Posted March 16, 2007 Share Posted March 16, 2007 it wouldn't technically cause any real problems. but say you went into one of the main categories from your top links. At that point the left hand categories box will only show the subcategories of that. The you click on something like say the "Shipping & Returns" link in the Information box. Since that link won't be passing on the $toplevel value, it becomes undefined or 0. So when you get to the shipping page, the categories tree will start from the very top level and would display all the categories including your main ones. And it'll stay that way until one of the upper links was clicked again to pass a new $toplevel value. Link to comment Share on other sites More sharing options...
Guest Posted March 16, 2007 Share Posted March 16, 2007 What if you had a default sub category list that it defaulted to instead of going back to the very top level again. That would solve it wouldnt it.? I need something like this myself and when I searched the forums I noticed quite a lot of people do, only theres no contrib or any solutions on the forums for it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.