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.

 

Inserting Module on Both Category Page and Product Page of Virtuemart

Inserting Module on Both Category Page and Product Page of Virtuemart

Hi, I'm having trouble placing a module on both a category page and a product page by category in my virtuemart installation.

I'm using the following code:

$vm = JomGenius("virtuemart");
if ($vm and $vm->check("pagetype = shop.product_details, shop.browse") ) {
  $category_id = $vm->info( "category_id" );
  if ($category_id == "1") return 35; /* module 35 for category 1 */
  if ($category_id == "2") return 37; /* module 37 for category 2 */

  return 39;
}

What's happening is, the module is displaying perfectly on the category page, but on the product page, I'm getting the following error:

Warning: Invalid argument supplied for foreach() in /home/..../modules/mod_metamod/mod_metamod/jomgenius/virtuemart.php on line 840

Any idea what I'm doing wrong?

thanks!
Eli

tayellet
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Inserting Module on Both Category Page and Product Page of Virtuemart

Hi tayellet,

Sorry about the error you were getting - this was due to a bug introduced in the last update to MetaMod.

I've just released a new version, 2.8, downloadable from the Download page:

http://www.metamodpro.com/metamod/download

Just install that over the last version, and I think the error will go away.

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10778
Newest User:
negina4qx
Members Online:
0
Guests Online:
167

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