Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

How do I assign a module to a Virtuemart category?

How do I assign a module to a Virtuemart category?

Hello,

How do I assign a module to a Virtuemart category?

Thank you

Edited By: jenna25
23-Jul-11 03:16:11

jenna25
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: How do I assign a module to a Virtuemart category?

Hi Jenna,

Assuming that you have everything else set up right (see the Quick Start guide), you can do the following:

$vm = JomGenius("virtuemart");
if ($vm->check("category_ids = 4, 5, 6")) return XXX;
// replace XXX with the module id to use on categories 4, 5 and 6

The "category_ids" keyword checks for all categories that a product has been directly placed into, not just its primary one.

If you want to check for all categories below a particular category, you can use this instead:

$vm = JomGenius("virtuemart");
if ($vm->check("ancestor_category_ids = 4, 5")) return XXX;
// replace XXX with the module id to use on categories 4 & 5,
//  and all their subcategories, and all their subcategories...


There are lots of other possibilities on the VM Recipe Page:
http://www.metamodpro.com/metamod/recip … mart-pages


Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10095
Newest User:
johnson58
Members Online:
0
Guests Online:
149

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked