Post by wickedcool » Fri Aug 26, 2011 7:49 pm

Hi all,

Firstly my apologies (mods) if this post is in the wrong place.
I know this question has been asked before, but I couldn't see much details in the conversation about how to do it.

Essentially I need to either modify the standard categories drop-down menu, or rip it out and implement something new. I need to be able to display at least one additional sub-level (possibly more, but one more will do for starters), so Category->Child Categories->Child Categories.

Now it sounds like it *should* be quite straightforward, but when I dig into the code it's maybe not quite as easy as that. To build the list the code loops through categories, and then checks for child categories - seems to use a defined array for categories, which I guess is build in the categories controller. I was thinking about interjecting so that for each child it sets that child catID to be the category, then runs the check for child again. There might be a way to make it work like that, and then move onto the headache of layout.

Is there a better/simple way? Would I be better ripping out the whole dropdown menu and replacing it with something better, and if so how would I begin that? I can see how to rip out the code from the header.tpl, so is it as simple as that?

Thanks in advance for any help or advice.

Newbie

Posts

Joined
Sat Jul 30, 2011 5:43 pm

Post by wickedcool » Wed Aug 31, 2011 7:50 pm

Ok, as no-one has replied, I'm guessing no-one has tried this before, so I'll use this thread to document how I get on.

First up, is this thread http://forum.opencart.com/viewtopic.php?f=21&t=34603

This looks like it has the required change in the module/category.php to setup a "sisters" array (which should be sub-sub-cats). Next is to work out how to replace this in the template/header.tpl file, as it uses a totally different set of php than is used in the category.tpl from the thread above.

Then it's probably some adjustment to the stylesheet.css to accomodate the new columns.
I'll see if I get any response in my post (in the above thread), but failing that I'm going to dive in and try to work it out. I think the category.php changes are all valid, it's just the other two that will need to change.

Any advice, input, etc, much appreciated.

Newbie

Posts

Joined
Sat Jul 30, 2011 5:43 pm
Who is online

Users browsing this forum: No registered users and 5 guests