Community Forums

Categories Menu to show sub-cats of current cat only

Template support & advice for OpenCart v1.x

Re: Categories Menu to show sub-cats of current cat only

Postby Chones » Sat Jan 01, 2011 1:18 pm

Hi Marc,

I've not tested this but, as we discovered, there is no path to the category on the Home page, so you could try changing the line
Code: Select all
if ($top_cat_id == $sub_path_id) {

to something like
Code: Select all
if (($top_cat_id == $sub_path_id) or ($path =='')) {


Happy New Year.

Yours,

Craig
User avatar
Chones
 
Posts: 755
Joined: Wed Mar 24, 2010 1:07 pm
Location: London

Re: Categories Menu to show sub-cats of current cat only

Postby marc_cole » Sat Jan 01, 2011 4:36 pm

Thanks, Craig. That did the trick. It looks much nicer now. I've included the latest vqmod file with this update and referenced your screen name as an author, as I couldn't have done it without you. I hope you don't mind.

Happy New Year to you, as well, and everyone else that I've had the pleasure of meeting so far on this board! Now that I've found OpenCart, I can tell that 2011 is going to be a very good year indeed!

Marc
Attachments
STORE__Show_Main_Categories_in_Header__SubCats_in_Sidebar.xml
This version adds top level cats to the home page.
(1.75 KiB) Downloaded 180 times
marc_cole
 
Posts: 217
Joined: Tue Dec 14, 2010 3:26 am
Location: Seattle, WA

Re: Categories Menu to show sub-cats of current cat only

Postby Chones » Sat Jan 01, 2011 11:08 pm

Cheers Marc, I'd've minded if you hadn't credited me ;)

Glad it worked. If you need any more help feel free to email me at craig@craigmurray.me.uk

Yours,
Craig
User avatar
Chones
 
Posts: 755
Joined: Wed Mar 24, 2010 1:07 pm
Location: London

Re: Categories Menu to show sub-cats of current cat only

Postby jesseh » Tue Jan 04, 2011 1:52 pm

hey guys, im trying to apply this to my openCart but i cant seem to get it working. Here are the details:

*im applying it to a fresh openCart install.
*i have installed VQMod (which is brilliant btw)
*ive placed the files attached in this thread in the VQmod folder in the root directory of my store

i dont see any change at all. Am i missing something? im very new to openCart and i haven't developed in php for almost 5 years, so im a little rusty.
jesseh
 
Posts: 4
Joined: Tue Jan 04, 2011 1:37 pm

Re: Categories Menu to show sub-cats of current cat only

Postby Qphoria » Tue Jan 04, 2011 3:32 pm

Take a look vqmod.log to see what you get there.
Take a look at the vqcache folder to see if there are any files there. If vqmod detects a problem it typically fails gracefully and passes the original source through to avoid any downtime
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18210
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: Categories Menu to show sub-cats of current cat only

Postby jesseh » Wed Jan 05, 2011 6:24 am

looking at my log file i can't seem to find where the mod changes the header.tpl file even though the mod file (from this thread) seems like it should be making a change to it. i also dont have a temporary file for the header in the vqchache folder.

would it help if i attached my log file?
jesseh
 
Posts: 4
Joined: Tue Jan 04, 2011 1:37 pm

Re: Categories Menu to show sub-cats of current cat only

Postby marc_cole » Wed Jan 05, 2011 4:20 pm

jesseh wrote: i also dont have a temporary file for the header in the vqchache folder.

Then the mod is not being applied. If it was, you'd see a file named something like this:
file:///opencart/vqcache/vqcache_catalog_view_theme_default_template_common_header.tpl
in the vqcache directory.

Can you get any vqmods to work, or is it just this one that you're having problems with?
marc_cole
 
Posts: 217
Joined: Tue Dec 14, 2010 3:26 am
Location: Seattle, WA

Re: Categories Menu to show sub-cats of current cat only

Postby jesseh » Wed Jan 05, 2011 6:36 pm

wow sorry guys i just had a blonde moment, after looking at the mod file again i realised that i needed the default theme applied first ... everything works fine now.

was the mod from this thread supposed to hide the category menu in the sidebar? because mine was still there so i disabled it in the module settings.
jesseh
 
Posts: 4
Joined: Tue Jan 04, 2011 1:37 pm

Re: Categories Menu to show sub-cats of current cat only

Postby marc_cole » Wed Jan 05, 2011 7:02 pm

jesseh wrote:was the mod from this thread supposed to hide the category menu in the sidebar?

Yep. Check out the first post in this thread.
marc_cole
 
Posts: 217
Joined: Tue Dec 14, 2010 3:26 am
Location: Seattle, WA

Re: Categories Menu to show sub-cats of current cat only

Postby Chones » Wed Jan 05, 2011 9:26 pm

Although you do need the category module enabled for this to work.
User avatar
Chones
 
Posts: 755
Joined: Wed Mar 24, 2010 1:07 pm
Location: London

Re: Categories Menu to show sub-cats of current cat only

Postby marc_cole » Wed Jan 05, 2011 9:51 pm

marc_cole wrote:
jesseh wrote:was the mod from this thread supposed to hide the category menu in the sidebar?

Yep. Check out the first post in this thread.

My mistake. It doesn't hide it — it just removes the top level cats from all pages except home.
marc_cole
 
Posts: 217
Joined: Tue Dec 14, 2010 3:26 am
Location: Seattle, WA

Re: Categories Menu to show sub-cats of current cat only

Postby jesseh » Thu Jan 06, 2011 7:04 am

Chones wrote:Although you do need the category module enabled for this to work.


still works for me after disabling the category module. I'm using the mod on this page not from page 1, maybe they work differently?

im learning the ins and outs of vqmod and opencart now so i should be good from now on :)

thanks to contributors to this mod and VQMod, using it is going to make my life much easier :)
jesseh
 
Posts: 4
Joined: Tue Jan 04, 2011 1:37 pm

Re: Categories Menu to show sub-cats of current cat only

Postby marcelwoo » Sat Jul 23, 2011 2:26 am

marc_cole wrote:
marc_cole wrote:
jesseh wrote:was the mod from this thread supposed to hide the category menu in the sidebar?

Yep. Check out the first post in this thread.

My mistake. It doesn't hide it — it just removes the top level cats from all pages except home.


Any chance of updating it to fit 1.5x?
It makes no sense that you have a megamenu in the header while keeping the category box below it displaying all level of cats and subs. I guess it looks very odd and stupid to visitors :-[
"We help each other to grow". That's the opencart community!

All free mods
Home Based Ebay business Opportunity(not ads)
User avatar
marcelwoo
 
Posts: 291
Joined: Mon Mar 28, 2011 5:45 pm

Re: Categories Menu to show sub-cats of current cat only

Postby ELDecors » Fri Apr 13, 2012 6:32 pm

Hi Marcelwoo

I'm not sure if you were able to find a solution but I have come up with a solution that works using some vqMods and modifying the "refine search" portion of the menu system. This kind of stumped me for awhile because like you I find the native menu system of opencart to repetitive and wanted to cut down on the clutter for my customers and simplify things. Until 2 months ago I had never looked at a piece of code in my life and kind of learned on the fly using forums, code websites and youtube. So as you can see, I am very new and with no previous experience in programming.

I noticed that when I posted my solution (located below) on March 23, 2012 on page 2 of the thread that it has started to appear in Themeforest templates for sale as of March 26th so there must be some merit to what I have done if its starting to find its way into professional templates.

viewtopic.php?f=20&t=48805

My store is still under construction and not live but if you look at the UStore template, for example, located for sale at Themeforest and then view demo you can see the basic design of my menu system. Choose "Components" on the main menu bar and then choose "monitors" and you will see how its works presenting the different levels and if its what you are looking for. The solution would be very easy to apply to your own template.

In my case, I have designed my category templates differently using a vqMod but it's all only window dressing and I've discovered the sky's the limit where presentation is involved. I have 4 levels of menu in some places before the product page appears and it works very cleanly only showing submenu of users choice with a detailed breadcrumb to backup on (ie. Home / Living Spaces / Furniture Collections / Heritage / product detail).

I hope this is of assistance.

Susan
ELDecors
 
Posts: 7
Joined: Thu Jun 02, 2011 1:32 pm

Previous

Return to Template Support

Who is online

Users browsing this forum: 2Wayne, davidmarch, marvmen21 and 21 guests

Hosted by Arvixe Web Hosting