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.

 

Newbie Getting a Recipe to work in Virtuemart

Newbie Getting a Recipe to work in Virtuemart

Hello,

I am using...
Joomla 2.5.8
Virtuemart 2.0.14
MetaMod Pro 3.13b

I have two modules that I want on every page of Virtuemart. So I used the following recipe.

$vm = JomGenius("virtuemart"); // need this at the start of every rule if ( $vm->check( "pagetype = frontpage, account.billing, account.index, account.order_details, account.orders, account.shipping, account.shipto, shop.browse, shop.ask, shop.cart, shop.infopage, shop.manufacturer_page, shop.product_details, shop.savedcart, shop.search, shop.waiting_list, shop.waiting_thanks, checkout.index#1, checkout.index#2, checkout.index#3, checkout.index#4, checkout.thankyou" ) ) return 110,111;

The module ID's are 110, 111.

But I am not getting it to show up.

Here is a link to the website.

http://temp.modwest.com/kettlehouse.com … Itemid=510

Thanks, Chuck

possum
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Hi Chuck,

sorry for the confusion – the example you used to form your code was based on the old 1.x version of VM. The newer version of VM has different names for the different page types. You can see a list of these in the JomGenius documentation:

http://www.metamodpro.com/jomgenius/parameters#vm2x

The new page types as listed are:

account.billing, account.index, account.order_details, account.orders, account.shipping, account.shipto
cart, cart.editpayment, cart.editshipment, cart.thankyou
category, searchresults
checkout.2Checkout_result, checkout.editbillto, checkout.editshipto, checkout.epay_result, checkout.ipayment_result, checkout.paysbuy, checkout.result
frontpage, order.view, orders, plugin.response
manufacturer, manufacturer.products (i.e. list of products from a manufacturer)
productdetails, productdetails.ask, productdetails.mailquestion, productdetails.notify (i.e. when asking for notification when product is available), productdetails.recommend (i.e. when e-mailing page to others)
shop.ask, shop.infopage, shop.registration, shop.savedcart, shop.search, shop.waiting_list, shop.waiting_thanks
user, user.editaddresscheckout, user.editbillto, user.editshipto, user.editshipto


Actually, a more foolproof way of determining if you are on a VM page is testing to see if the $option variable equals "com_virtuemart"

e.g.

if ($option == "com_virtuemart") return "110, 111".

You always need the double quotes around the list of module ids that you are returning, too. That could have been part of your original problem.

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Hi Stephen,

Thanks for the reply. So my basic recipe that goes in the PHP box would look like this...

$vm = JomGenius("virtuemart") if ( $vm ) { echo "productdetails, productdetails.ask, productdetails.mailquestion, productdetails.notify " . $vm->info("page_type"); }

$option variable equals "com_virtuemart" e.g. if ($option == "com_virtuemart") return "110, 111"

Where for example, productdetails, productdetails.ask, productdetails.mailquestion, productdetails.notify are the pages that Metamod would show up on.

Is that correct?

Thanks, Chuck

possum
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

ooh, I hope you don't try to use that verbatim in the PHP box, as it's not valid PHP.

Ok, here goes: If you want something to simply appear on all VM pages, use only this in the box:

Code:

if ($option == "com_virtuemart") return "110, 111";

If you want to select particular VM pages for the module(s) to appear on, use this:

Code:

$vm = JomGenius("virtuemart");

if ( $vm->check("pagetype = productdetails, productdetails.ask, productdetails.mailquestion, productdetails.notify")) {
  return "110, 111";
}

See how it works?

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Hi Stephen,

Sorry for my ignorance on this issue.

I put the simple code above for the modules to show on every VM page.

But they still are not showing. I think I am missing some thing in the basic configuration. Do I still need to apply the module to the VM menu item?

I have a screen shot but I don't see an option for uploading an image.

Thanks again, Chuck

possum
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Checklist:

1 - MetaMod is assigned to either the VM menu item or all menu items. I'd suggest ALL, as sometimes VM pages appear when they are not on the VM menu item (e.g. sometimes the checkout pages etc).

2 - MetaMod is published

3 - MetaMod is assigned to the module position where you want the target module to appear

4 - target module is set to appear on no menu items, or set to appear on a non-existant module position (e.g. "for-metamod"). I usually keep it published as well.

Hope that 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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Hi Stephen,

Applying the Metamod Module to All Pages was the solution.

Thank you very much!

Cheers, Chuck

possum
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Hi Stephen,

Another quick question. I have another website that I need to remove modules from all VM pages.

How can this recipe be written to remove certain modules from all VM pages.

if ($option == "com_virtuemart") return "110, 111";

Thanks, Chuck

possum
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Newbie Getting a Recipe to work in Virtuemart

Hi Chuck,

Basically MetaMod just adds modules to pages, not removes modules from pages, so you just need to think about your situation that way. In other words, think of it as "add modules to all pages that are not VM pages".

So as I mentioned in a previous post, you need to ensure that the target modules are not going to show up until MetaMod includes them.

Then, use the following rule to add the modules ONLY on non-VM pages:

if ($option != "com_virtuemart") return "110, 111";

The "!=" thing means "not equal to". So on every page where the component is not equal to com_virtuemart, include the modules. Easy!

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
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4401
Newest User:
jason59312
Members Online:
0
Guests Online:
118

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