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.

 

Metamod recipe for a newbie

Metamod recipe for a newbie

Joomla 1.5.23
VirtueMart 1.1.19

I am very new to VirtueMart and it is my first time to create e-commerce.  I read through the forums and I also Tried the recipes myself.  However, I could not get it to work.  What did I miss?  I apologize for the lack of knowledge for this.  I would like to ask for a little help in making me understand how to remove/hide all modules from all VirtueMart pages especially the shop.product_details.

here is the recipe, I put to hide the modules in VirtueMart pages.

[highlight]$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( $vm->check( "pagetype not = frontpage, shop.cart,shop.product_details" ) ) return 18;[/highlight]

thank you in advance.

I forgot to give a link to my site: www.hybridmom.co.jp
As you can see, It's a normal "Joomla Frontpage" with modules.  The products are virtuemart modules but when I click on the products, the virtuemart page (shop.product_details) would also display the Joomla modules.

I don't know if I am explaining this clearly.  I badly need help.

Thanks so much.

Edited By: annois
18-Jul-11 02:58:51

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

Re: Metamod recipe for a newbie

Hi annois,

In order to hide the modules on the VM pages, you need to put the modules under the control of MetaMod. Let me explain:

With MetaMod, instead of thinking "I want to hide modules on some pages", you have to think "I want to show the modules on all pages except those pages".

Steps:
1 - create all the target modules, the ones that you want to show/hide on different pages
2 - in each target module, set the "Menu items" control to "none" so that by default, they will not show anywhere. We'll get the MetaMods to selectively show them on the right pages.
3 - create 1 MetaMod per module position that your target modules are in (perhaps "top", "right", "user1" etc).
4 - the MetaMods have to be published, and I recommend that they are set to "ALL" menu items.
5 - for the PHP rule in each MetaMod, use the following:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( $vm->check( "pagetype = none of frontpage, shop.cart,shop.product_details" ) ) return XXX;
// replace XXX with the id of the target module that you want to display in this position.

If there's more than one module to display in that position, you can return both module ids like this:

if (... condition here ...) return "101, 102";


If you want the modules removed from EVERY possible VM page, then you can replace the entire rule above with this one:

if ($option != "com_virtuemart") return XXX;
// replace XXX with id of the target module you want to display in this position.

Best regards,
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:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11541
Newest User:
kajha63864
Members Online:
1
Guests Online:
212

Online: 
kajha63864

Forum Legend:

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