New Products & Categories Menu - J! Style, Suffix, Itemid, SSL, Cat Start, Hide

Started by Forrest, December 27, 2009, 16:06:47 PM

Previous topic - Next topic


Hello VM fans,

Looking for XHTML ul, li, span menu output for VM Categories &/or Products?
Looking to be able to specify:
Module Class Suffix?
Menu ID Suffix?
Menu Class Suffix?
Product Class Suffix?
Parent, Active, Current Suffixs?
Store ID Override for Categories?
Store ID Override for Products?
Category Start?
Level Start?
Level Stop?
Sort Categories by Order or Name?
Hide Specific Category Items(s)?
Show # of Sub Categories?
Show # of Products in Category?
Show Products in Menu?
Categories or Products first?
Sort Products by Name or SKU?
Hide Specific Product Item(s)?
Always Show Sub Items?
Option to create a flyout menu like: (left menu)
Option to add Main-level Category Images in Flyout
Option to use Category / Product Images as Menu Items
Leverage J1.5! JRoute for SEF?

This mod will create a regular Joomla style output and give you the ability to specify a specific category to display ONLY, or use it as a products menu! Lots of additional options...
QuoteHere's an example category set for virtuemart:

  • By Product

    • Watches
    • Shoes

      • Big Shoes
      • Small Shoes
    • Hats
  • By Application

    • Firemen
    • Police

      • Vests
      • Hats
    • Saftey

Maybe you just want to display the sub menu for "By Product" to create a menu like:

  • Watches
  • Shoes

    • Big Shoes
    • Small Shoes
  • Hats
You can do it with this mod easily. Specify the start cat id for "By Product" and a start level of 1.

If you wanted just:

  • Big Shoes
  • Small Shoes
You can do this by:
specifying the start cat id for "By Product" and a start level of 2
specifying the start cat id for "Shoes" and start level of 1

Or, with update 1.2, you can specify a STOP level as well, if you want:

  • By Product

    • Watches
    • Shoes
    • Hats
  • By Application

    • Firemen
    • Police
    • Saftey
In the above example, I do not ever want to show level 3, so I:
specify no start category id, which means it starts with master cats, and a start level of 1 and end level of 2, meaning it will show the first two levels (master and 1st sub).

You may chose to always display sub categories below specified start cat or not. You may add your suffixes; easily change the class & id call names for css if you do not wish to use the joomla defaults: (parent active current). You may even override Joomla Itemid for store. If you are having difficulties with using a Joomla menu as your VM menu then this is your solution!

You can see a demo here (non-flyout):
This displays the ability to have 2 separate main category menu (by product) & (by application) of which sub & sub-sub of each main cats are displayed in two separate menus.

I added support to force, unforce, or ignore SSL for all cat links in the mod, like you would be able to in the regular Joomla menu params... This is beneficial when turning J! SEF on, which currently causes VM to ignore the "Generally Prevent Secure Connections" setting. And as a note, you when you are using HTTPS with VM and J SEF on, you should assign all your Joomla menu items to be NON-SSL (under ADVANCED for each J! menu item), if you do want to generally prevent secure connections.

Screenshot of module parameters for specific category menu:

This is what the Flyout can look like with just a little CSS adjustments.

[UPDATE] 03-02-2010 -> download v1.1

  • Fixed Subcategories of ACTIVE Parent Items Not Showing
  • Files modified: class.vm_cat_menu_specific.php

[UPDATE] 03-05-2010 -> download v1.2

  • Added support to specify a STOP level.
  • Small fix in starting with categories at level 2 or greater
  • Files modified: all mod files modified

[UPDATE] 03-07-2010 -> download v1.3

  • Fixed error in showing categories at level 3 or greater
  • Added support to show # of sub-categories and/or products in category, like: (11/23)
  • Files modified: all mod files modified

[UPDATE] 03-09-2010 -> download v1.4 (a big step up in menu options)

  • Added support to easily change Parent, Active, Current Class/ID Suffix
  • Added support to hide a specific, or multiple specific category items
  • Added support to use as a products menu
  • Added support to hide product menu items in a specific category
  • Added support to hide a specific products, or multiple products in menu
  • Files modified: all mod files modified

[UPDATE] 03-11-2010 -> download v1.5

  • Fix: Products not showing when in category with no sub-categories
  • Added options to assign products to a different Itemid Override
  • Added option to choose whether categories or products are listed first
  • Added option to sort categories by "As Ordered" or by "Name"
  • Added option to pre or post pend categories identifier
  • Added option to sort products by "Name" or by "SKU"
  • Added option to pre or post pend products identifier
  • Files modified: all mod files modified

[UPDATE] 03-12-2010 -> download v1.6

  • Fix: \' Characters appearing where only ' should appear
  • Fix: Array issue when Hiding Categories
  • Fix: Array issue when Hiding Products
  • Fix: item # incrementation
  • Files modified: all mod files modified

[UPDATE] 03-15-2010 -> download v1.7 (this really should be the last update for a bit!)

  • Fix: Category id value not passing to product links (prevented menu from expanding to current level when product was clicked)
  • Fix: Minor css variable fix with item#s
  • Fix: Minor css variable fix with product links
  • Files modified: class.vm_cat_menu_specific.php

[UPDATE] 03-22-2010 -> download v1.8

[UPDATE] 03-31-2010 -> download v1.9

[UPDATE] 04-02-2010 -> download v2.0

  • Major Update in Code; No alterations to available settings
  • Removed redundant processes (better performance)
  • Changed way code passing parameters (better performance)
  • Altered queries to find if subs exist (better performance)
  • Fix: Minor CSS fix with product items
  • Files modified: All Files Modified

[UPDATE] 04-03-2010 -> download v2.1

  • Another Major Update in Code; Not necessary to download 2.1 unless you want a "Flyout Sub-Menu".
  • You can view a sample of flyout here (left menu):
  • All new parameters are for Flyout options
  • Option to display category Full or Thumb images of Main-level in Flyout div.
  • Includes 5 different image color backgrounds. Change in CSS.
  • Use CSS to adjust flyout according to your template needs. CSS help from me will be limited. I suggest you learn CSS if you do not know it. The Flyout option should not be used if your a novice to CSS and are not willing to figure it out yourself!
  • Fix: Added blank index.html files to each folder
  • Files modified: All Files Modified
  • Files added:

    • js/flyout.js
    • css/flyout.css
    • images/xxxx.gif (5 images)

[UPDATE] 04-03-2010 -> download v2.2

[UPDATE] 04-04-2010 -> download v2.3

  • Fix: Flyout Menu Error. Flyout pops-up even when no sub items are present.
  • Files modified: class.vm_cat_menu_specific.php

[UPDATE] 04-16-2010 -> download v2.4

  • Addition: Allows for "Always Show Subs of 1st Sub Level". This means you can always have your main level items and your first set of sub level items visible at all times.
  • Files modified:

    • class.vm_cat_menu_specific.php
    • mod_vm_cat_menu_specific.php
    • mod_vm_cat_menu_specific.xml

[UPDATE] 04-29-2010 -> download v2.5

  • Addition: Use Category / Product Images as menu items.
  • Addition: More logical module parameters layout.
  • Fix: Minor fix in redundant database calls.
  • Files modified:

    • class.vm_cat_menu_specific.php
    • mod_vm_cat_menu_specific.php
    • mod_vm_cat_menu_specific.xml

[UPDATE] 05-21-2010 -> download v2.6

  • Fix: Missing li end tag for listing products.
  • Files modified:

    • class.vm_cat_menu_specific.php

[UPDATE] 06-04-2010 -> download v2.7

  • addition: Added VM sort order for products (not just alpha or sku).
  • Files modified:

    • class.vm_cat_menu_specific.php
    • mod_vm_cat_menu_specific.xml

[UPDATE] 09-06-2010 -> download v2.8

  • edit: Fix menu class parameter not passing correctly.

[MAJOR UPDATE] 02-17-2012 -> download v3.0

  • additions: Too many to list.
  • fixes: Too many to list.
  • Files modified: ALL Files; New files added.

[MAJOR BUG FIX] 04-06-2012 -> download v3.0.1

  • fix: Menu collapsing when on level 3 or deeper, now fixed.
  • File modified: class.vm_cat_menu_specific.php

Below are the download available.

Please report bugs on at this post. Thanks - F

Please take a minute of time to leave a review here:

If you like or found useful, please donate at to

[attachment cleanup by admin]



Thanks a lot !
I'll try it tonight, should do the trick...


GREAT module !
Performs so simply in a few seconds what i've been trying to do for such a long time !

Many thanks Forrest !


How can i make my menu style like this site


This is styling and javascript. You would need to create css for your menu, apply the class suffixes via the module params, and find a script that would support the dropdown function.

If you don't need to separate your categories then look around the forums for an accordion menu, or something of those sorts. I've seen one or two.


Thank you Forrest - looks like what I need but cant get it to work.

Your module left Top. Settings in ADMIN :
Category Start = 5
Level Start = 3
Managing Member of Hosting-Webdesign [url=""][/url]


Looking at this example, you have a submenu item of "indoor tools" as cat_id "5", which you are specifying as your start category. So that is where your menu would start. The problem is, there are no subcategories of "indoor tools", so of course the menu outputs nothing.

In this example from your site, if you wanted to just show only the categorie under "Power Tools", you would have a start category id of "2", and a start level of "1".

Your menu would then list:
-> Outdoor Tools
-> Indoor Tools

These are the sub caetgories of cat id "2", Power Tools.


Hi Forest,

Thank you for the quick reply. I am not getting how this works. I tried your example 2  and Level 1 and that worked. What would I enter to only display bliddyspam Cricket Bats, bliddyspam Gloves and bliddyspam Batting Pads ?
Managing Member of Hosting-Webdesign [url=""][/url]


Create a category called "bliddyspam" or "bliddyspam Batting" and move those three categories you listed under the new category I suggested.

You would have something like:
    ->bliddyspam Gloves
    ->bliddyspam Pads

Now find the category id of "bliddyspam" (which probably would be 9 or 10 in ur case) and put that as your start category, with a start level of 1.


oh I think I am getting it - it has to work on sub categories.... So I cant have 3 Parent Categories there... It works on :


Thank You Forest I will go try that...
Managing Member of Hosting-Webdesign [url=""][/url]


Thank You ! That worked....

I styled the module according to the site and its working exactly like I wanted to!
Managing Member of Hosting-Webdesign [url=""][/url]


Just a note, it doesn't have to be subcategories. If you want to have it act just like a regular menu, don't fill in start cat or start level... It will just list off all your master cats like a regular joomla menu style


Hi Forrest,

One of the aspects I liked about the original VM mod_virtuemart_product_categories was that when you click on a parent category, it takes the user to a page with the category info while the sub-categories are then exposed in the menu for just that category.

I really *really* like the SSL features of your menu tho, so I'm wondering if there's any way to get it to behave the way I've just described?