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.

 

Magic Combination for Virtuemart

Magic Combination for Virtuemart

I haven't been able to find the right code after days of searching the forums and recipe section so hopefully I can get the right php code to configure this module the right way:

1. I am having difficulty keeping the modules I want to display ONLY on the Joomla frontpage (not virtuemart). I keep thinking I got it figured out and then I see it pop up in other areas of virtuemart.   What would the correct code be to show the modules ONLY on the JOOMLA frontpage and what would the correct settings in the actual metamod module be? Does it matter what menu selection I choose?etc.

2. I can't seem to figure out how to show certain modules that will appear on specific categories and any of the product browse pages that are inside those specific product categories and how to string it together with another recipe that makes sure that those modules DO NOT appear during the shopping cart view and checkout process. Please help me as I don't know php code and I know this module can do those things if I only knew the code.  Thanks again.

redlinesuperstore
Guest
useravatar
Offline
Administrator has disabled public posting

Re: Magic Combination for Virtuemart

Hi redlinesuperstore,

sorry it's taken a while to respond. I'm on a 3-week 8-country 9-flight work trip at the moment and the forum support has slipped a bit sad

1 - this really depends on what type of front page you are using. There's a difference between the standard Joomla "front page" content view, and the normal VirtueMart "front page" view, and any other type of page that you might be using as the default page on your site (a.k.a. your front page).

If for example you are using a standard article as your front page, then you can use a recipe like this, that detects a certain article by ID. If it finds that, then this is your front page and it imports the modules:

if ($content_genius->check("article_id = 123")) return XXX;
// replace XXX with module id to display when article 123 is displayed

If you're using a Virtuemart menu item as your front page, then you can probably use this:

$vm = JomGenius("virtuemart");
if ($vm->check("pagetype = frontpage") and $Itemid == BBB) return XXX;
// replace XXX with module id to display when VM frontpage is displayed
// and you are on Itemid BBB (replace with a valid Itemid for the VM page).

(note: this may be affected by how the VM menu item is set up)

In this case I would generally assign the MetaMod to just the Front Page menu item (whichever one that is) to avoid the chance of it activating on the wrong pages for any reason. In that case you wouldn't even need to check for "and Itemid = BBB" since assigning this to the front page menu item does exactly the same thing.


2 - making modules appear only on specific category pages and browse pages, and NOT on shopping cart or checkout pages:

$vm = JomGenius("virtuemart");
// restrict to just these types of pages:
if ($vm->check("pagetype = shop.browse, shop.product_details")) {
  // now check to see if any of the ancestor category
  // ids of the current item are in the list given:
  if ($vm->check("ancestor_category_ids = 41")) return AAA;
  if ($vm->check("ancestor_category_ids = 42")) return BBB;
  if ($vm->check("ancestor_category_ids = 43")) return CCC;
  if ($vm->check("ancestor_category_ids = 44")) return DDD;
  if ($vm->check("ancestor_category_ids = 45,46,47,48")) return EEE;
}
// replace AAA with module id to use for category 41
// replace BBB with module id to use for category 42
// replace CCC with module id to use for category 43
// replace DDD with module id to use for category 44
// replace EEE with module id to use for categories 45, 46, 47 and 48
// Add more as appropriate.


The modules returned can't appear on the checkout pages etc, only on the browse and product details pages, so you should be safe there.


Hope this helps,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11577
Newest User:
owens65784
Members Online:
0
Guests Online:
186

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