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.

 

VirtueMart questions

VirtueMart questions

[Admin note: moved to its own topic in MetaMod:General]

Nika76 wrote:

Im using Joomla 1.5.11. version and MetaMod 2-0.

I cant get MetaMod working for me. Im trying to display diffrent modules on different Virtuemart product detail pages.
Every product detail page has to have its own module.
I dont understand how to prepare modules so that they could be visible only on certain Virtuemart pages.
Please, it would be a huge help if you could tell me step-by-step what to do.

I was trying to use this code:

if ($option == "com_virtuemart") {
$page = JRequest::getVar("page");
if ($page == "shop.product_details") {
if ($product_id == "4") return 99;
  }

}

Nothing happened...just blank space on every Virtuemart page.


    * Last but not least, a URL for your own site if it's public.

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

Re: VirtueMart questions

Hi Nika,

Can I assume that you've read the setup guide on MetaMod Quick Start ?

Once you are sure that the basic setup is right, it's time to look at the rules in the PHP box.

There's only one thing wrong with the recipe that you quoted -- it doesn't know where to get the "product_id" variable from. So you just need to tell it to get that from the URL.

Try this:

Code:

if ($option == "com_virtuemart") { 

  $page = JRequest::getVar("page");
  if ($page == "shop.product_details") {
    $product_id = JRequest::getVar("product_id");
    if ($product_id == "4") return 99;
  }
}

This recipe should then display module 99, but only on the product details page for product id 4.

Does that work for you? Write back if you're still having trouble with it.

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

Re: VirtueMart questions

Thank you very much!!! This works for me.
At first, I didnt read the setup guide from start to end. After reading it, I managed to work something out by using Advanced Metamod Debug. Your suggestion works as well, and its easier, I think.
The only problem I still have is the white space on other pages where Metamod module should not appear.
I had to change its position so It would not ruin the other pages.
Is there any solution to that?

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

Re: VirtueMart questions

Hi Nika,

read the FAQ about White space issues where modules are turned off. This mostly happens in left and right columns where the template reserves space based on there being at least 1 published module in a module position - in this case, the MetaMod, even when it doesn't have anything in it.

The easiest and best solution is MetaMod Pro which completely gets rid of modules that don't appear, and works with any template without template modifications being necessary. It's really easy to install and to get the results that you want. But some other approaches are mentioned in that FAQ 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
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10112
Newest User:
chris28464
Members Online:
0
Guests Online:
137

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