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

Jeremo

  • Beginner
  • *
  • Posts: 9
Multiple VM Category Menus
« on: May 07, 2008, 23:56:30 pm »
I've been playing around with VM for the past few days and reading on the forums but I cannot seem to find a solution for the issue I'm having.

I need to be able to pull multiple VM Category Menus.  let me explain with a structure below.  I'll use computer name brands as an example


Dell - VM Menu title
Laptop
Desktop
Server
  - Cat lvl 2
    - Cat lvl 3

Hewlett Packard - VM Menu title
Laptop
Desktop
Server
  - Cat lvl 2
    - Cat lvl 3

Alienware - VM Menu title
Laptop
Desktop
Server
  - Cat lvl 2
    - Cat lvl 3


What this shows above is actually putting the VM Category Module in my left navigation 3 times, but it pulls only the categories assigned to it.  Currently it looks like you can only have 1 VM Category Module and all of your categories have to be inside it.

This works great for those with small category lists.  But if you want overall shopability and ease of use, you have to utilize multiple menus.

Is this possible within VM?

samoht

  • Jr. Member
  • **
  • Posts: 104
Re: Multiple VM Category Menus
« Reply #1 on: May 08, 2008, 04:32:03 am »
This is what I want to know as well.

Can we modify the vm module and duplicate it?
(Preferably - be able to specify what categories to include in joomla admin)

I use Joomla 1.5! and VM 1.1

Jeremo

  • Beginner
  • *
  • Posts: 9
Re: Multiple VM Category Menus
« Reply #2 on: May 08, 2008, 15:36:38 pm »
Or i'm open to a 3rd party plugin for VM that can perform this type of function as well.  I tried playing around with Menu manager and

a) couldn't get it to work
b) don't think it will work for this solution.

Jeremo

  • Beginner
  • *
  • Posts: 9
Re: Multiple VM Category Menus
« Reply #3 on: May 09, 2008, 06:59:25 am »
Anybody?

rkl123

  • Beginner
  • *
  • Posts: 5
Re: Multiple VM Category Menus
« Reply #4 on: May 09, 2008, 15:19:57 pm »
I also need this urgently ;-)

Any news on this ?? PLease ..........

Jeremo

  • Beginner
  • *
  • Posts: 9
Re: Multiple VM Category Menus
« Reply #5 on: May 12, 2008, 18:23:36 pm »
Blah no help at all :(

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Multiple VM Category Menus
« Reply #6 on: May 12, 2008, 20:44:19 pm »
This is a new idea, maybe the developers didnt thaught about it and cannot respond.

I like your idea

willowtree

  • Full Member
  • ***
  • Posts: 542
    • Willow Tree Crafts
Re: Multiple VM Category Menus
« Reply #7 on: May 12, 2008, 20:51:50 pm »
for 1.0 there was something that i installed that alllowed you to make a VM category as a menu item and select from th evm category list, but i'm not sure that's available for 1.1

Can you not just create menu links to the relevant categories as URL links in the menu manager?
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 #8 on: May 12, 2008, 21:08:45 pm »
In a large store where you have several sub categories and new categories being created frequently - it is not desirable to have to create a menu for each category manually.

At least not for me :)
I use Joomla 1.5! and VM 1.1

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Multiple VM Category Menus
« Reply #9 on: May 12, 2008, 21:18:06 pm »
hey willowtree,
please search the hack or the ”how to” and explain how you did that :P
See ya

samoht

  • Jr. Member
  • **
  • Posts: 104
Re: Multiple VM Category Menus
« Reply #10 on: May 13, 2008, 15:37:17 pm »
I am wondering if...

I add
Code: [Select]
<param name="catid" type="text" default="" label="Category ID" description="PARAMCATEGORYID" />
into mod_product_categories.xml

can I just pass the value(s) into mod_product_categories.php to limit the categories pulled?



I thought that replacing:
Code: [Select]
$category_id = vmGet( $_REQUEST, 'category_id');
with my passed values
Code: [Select]
$catid = trim( $params->get('catid') );
and then just modifying:
Code: [Select]
echo $ps_product_category->get_category_tree( $category_id, $class_mainlevel );to
Code: [Select]
echo $ps_product_category->get_category_tree( $catid, $class_mainlevel );at the end of the file would do the trick - but nothing seems to change??
I use Joomla 1.5! and VM 1.1

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Multiple VM Category Menus
« Reply #11 on: May 13, 2008, 15:59:43 pm »
Hi,
Try this idea:
Create a new vertical menu.
Copy every category's link into the new menu as an internal link.
Try on your demo site.

Note:
-Do not modify the core modules, it can produce damage to the functionality of VirtueMart core application.
-This should work without using any SEF enabled.

MKI-Miro

  • Jr. Member
  • **
  • Posts: 160
Re: Multiple VM Category Menus
« Reply #12 on: May 13, 2008, 16:42:32 pm »
making virtuemart menu as joomla menu for this purpose is not good

i have got one suliton for all of you

you have to modify ps_product_category.php

1.find this row in function get_category_tree
$catname = shopMakeHtmlSafe( $category_tmp[$row_list[$n]]["category_name"] );

2.add and change this

//this is the menu 1
if (($category_id == 1) || ($category_id == 7)) //categories that you want to show
  if (($catname == "Veľké postavy") || ($catname == "Morský svet")) //name of categories that you want show

     $html .= '<li>'.str_repeat("&nbsp;&nbsp;&nbsp;",$depth_list[$n]-1).'<a title="'.$catname.'" style="'.$style.'" class="'. $css_class .'" href="'. $sess->url(URL."index.php?page=shop.browse&amp;category_id=".$category_tmp[$row_list[$n]]["category_child_id"]) .'" '.$append.'>'. $catname . ps_product_category::products_in_category( $category_tmp[$row_list[$n]]["category_child_id"] ).'</a></li>';

  }
}

//this is the menu 2
if (($category_id == 3) || ($category_id == 4)) //categories that you want to show
  if (($catname == "Balóny") || ($catname == "Podmorský svet")) //name of categories that you want show

                    $html .= '
              <li>'.str_repeat("&nbsp;&nbsp;&nbsp;",$depth_list[$n]-1).'<a title="'.$catname.'" style="'.$style.'" class="'. $css_class .'" href="'. $sess->url(URL."index.php?page=shop.browse&amp;category_id=".$category_tmp[$row_list[$n]]["category_child_id"]) .'" '.$append.'>'. $catname . ps_product_category::products_in_category( $category_tmp[$row_list[$n]]["category_child_id"] ).'</a></li>';

  }
}

and now you create menu item in joomla menu -> virtumart -> and in the right box wrtie what category id you want to show

ask me if you dont understand somethink :)
i have find no better solution for this

enjoy :)

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Multiple VM Category Menus
« Reply #13 on: May 13, 2008, 17:21:13 pm »
Any VM tester tried it? Maybe this could be useful for much more developers, and can be integrated into VM core functions.
Ciao

PS: I don have time now but I promise to test it for myself.

samoht

  • Jr. Member
  • **
  • Posts: 104
Re: Multiple VM Category Menus
« Reply #14 on: May 13, 2008, 17:31:23 pm »
Thank for this pointer.

I think I understand - but I wonder if there is a way to do this with a parent category Id so all its sub categories show up?

I tried this solution - and it works - but you still have to manually add all the categories to get the menu you want. (and you have to add it in the code)
I use Joomla 1.5! and VM 1.1