Author Topic: Multiple VM Category Menus  (Read 14161 times)

samoht

  • Jr. Member
  • **
  • Posts: 104
Re: Multiple VM Category Menus
« Reply #15 on: May 13, 2008, 17:46:39 pm »
why can't I just put
if(($category_parent_id == 1)&&($category_id > 0))

??
This still only returns my parent category. I assume because of the joomla menu where I chose the Category Id?? yes?
I use Joomla 1.5! and VM 1.1

MKI-Miro

  • Jr. Member
  • **
  • Posts: 160
Re: Multiple VM Category Menus
« Reply #16 on: May 13, 2008, 17:58:19 pm »
i know that my solution is not very good and have to be hardcoded but it works ...
you can visit it on www.300.sk where navigation in red is joomla menu
and navigation in left side is virtuemat category tree

Jeremo

  • Beginner
  • *
  • Posts: 9
Re: Multiple VM Category Menus
« Reply #17 on: May 14, 2008, 17:35:25 pm »
Thanks for all the responses everyone!   The reason I  bring this up is because it's an e-commerce standard in my eyes so i was shocked to not see it in virtuemart since it's an already awesome free e-commerce app.  I'm going to try a few things and see if I can come up with anything as well as use your examples provided.

Jeremo

  • Beginner
  • *
  • Posts: 9
Re: Multiple VM Category Menus
« Reply #18 on: May 14, 2008, 17:37:51 pm »
One thing to keep in mind, if this was a store for me, i wouldn't have a problem editing code to add more menu's etc....but i'm building this for someone else and they don't know how to develop.  So any solutions through the admin end would be prime.

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Multiple VM Category Menus
« Reply #19 on: May 16, 2008, 14:16:55 pm »
any other VirtueMart power user have something to say about it?

willowtree

  • Full Member
  • ***
  • Posts: 542
    • Willow Tree Crafts
Re: Multiple VM Category Menus
« Reply #20 on: May 17, 2008, 14:45:38 pm »
why not simply set up the categories in this way and then just use the module, it also decreases the number of queries as you're only running the category list once not 3 times?
Please add your VM and Joomla Version to your signature to make it easier to help you:

Most of my code posted in the forum is for VirtueMart 1.0  -  not for 1.1

samoht

  • Jr. Member
  • **
  • Posts: 104
Re: Multiple VM Category Menus
« Reply #21 on: May 17, 2008, 15:24:00 pm »
OK, I came up with a pretty nice solution that is only a little hack.

In ps_product_category.php in the function get_category_tree

add:
$hidden_style="display:none; to the end of the arguments. So my function looks like this:
Code: [Select]
function get_category_tree( $category_id=0,
$links_css_class="mainlevel",
$list_css_class="mm123",
$highlighted_style="font-style:italic;",
$hidden_style="display:none;" ) {

Then just above the $catname = ... in the final else of the for loop add this:
Code: [Select]
if( $style != $highlighted_style){$style = $hidden_style;  }
so that the whole else statement looks like:
Code: [Select]
else {
$css_class = $links_css_class;
if( $style != $highlighted_style){
$style = $hidden_style;
}
}

The result is that on what ever category main page - only the active parent category and its subcategories show up. If you don't want to show the parent category just remove the condition "if( $style != highlighted_style )" but keep the "$style = $hidden_style;" and that will show only the sub categories in the active category.

hope this helps!  ;)
I use Joomla 1.5! and VM 1.1

MKI-Miro

  • Jr. Member
  • **
  • Posts: 160
Re: Multiple VM Category Menus
« Reply #22 on: May 23, 2008, 22:57:29 pm »
really working ?

samoht

  • Jr. Member
  • **
  • Posts: 104
Re: Multiple VM Category Menus
« Reply #23 on: May 23, 2008, 23:35:57 pm »
well mostly working. The problem is that the categories all go away when you go to the cart - because then none of the categories or subcategories have the $highlighted_style - but other than that it is working
I use Joomla 1.5! and VM 1.1

MKI-Miro

  • Jr. Member
  • **
  • Posts: 160
Re: Multiple VM Category Menus
« Reply #24 on: May 24, 2008, 20:50:37 pm »
i tried

but its not working if you want to show all parent categorie, for exmaple

-one
 -two
 -three
  -four
  -five
 -six
  -eight
  -nine
-ten

when four is active i want to be visible this categories: one, two, three, four, five, six.

hmm any module for this sholud be maked :)

NaGGi

  • Beginner
  • *
  • Posts: 31
Re: Multiple VM Category Menus
« Reply #25 on: March 12, 2009, 09:49:12 am »
I managed to do this with module(mod_vm_vertical_menu). It needs a little bit of knowledge in html/css/php/mysql/xml to make it work though.

You need to edit the module files so that you can install another module. Changes names in xml and one function name in php.

Then you need to change the sql query to fetch what you want to see in that php file.

That way you should be able to pull out different menus to different categories(if you know mysql).

This is not good solution but it can be done. Getting the CSS right for this module is already a pain.