Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



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


no modules on virtuemart cart or checkout pages

no modules on virtuemart cart or checkout pages


I am sorry, but I can't get it to work. I dont want to show modules on the cart or checkout pages from virtuemart.

I inserted the following code:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( ! $vm->check("pagetype starts with checkout, cart") ) return sidebar-2;
/* replace XXX with the module id or position you want
* to display <em>except</em> on any of the checkout or cart pages

The modules on the position sidbar-2 I dont want to show. What did I do wrong?

Also where do I have to publish the MetaMod Module? On the position sidebar-2 and only on the menu item Shop? Is that right?

I have read the recipes but I dont understand it really. Hope you can help.

MEtaMod: Latest Version
VirtueMart: Version 2.0.26a
Joomla 2.5.16

THank you.

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: no modules on virtuemart cart or checkout pages

Hi miwadesign,

There are a few basic setup things that you need to have before this will work for you.

1 - you need to make sure that the modules you want to control don't appear on the page until MetaMod assigns them. Therefore you usually need to disable them in some way, or assign them to a module position that doesn't appear on your page.

So in your case, if they are currently in position "sidebar-2", then instead put them all into "sidebar-2-hidden". That way you stop them from appearing (yet!).

2 - in the position where you want them to eventually appear (sidebar-2), place the MetaMod. In the MetaMod, use the following PHP code:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( ! $vm->check("pagetype starts with checkout, cart") ) return "sidebar-2-hidden";

Note that there are double quotes around the name of the module position. That's important.

The MetaMod has to be published, assigned to ALL pages (or at least a subset of menu items that includes the pages you want it to show on), and assigned to the module position that you want the target modules to be displayed in.

So what happens now is that when Joomla goes to display the sidebar-2 position, it finds ONLY the MetaMod there. The MetaMod PHP executes and identifies whether the current page is a VM checkout or cart page, or something else. If it's something else, then all the modules from the position "sidebar-2-hidden" are placed inside the MetaMod.

In this way, the modules appear on most pages, but disappear on cart and checkout pages.

Hope that helps,

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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky