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.

 

Cart on Virtuemart products pages

Cart on Virtuemart products pages

Hi,

I am trying to put the shopping cart on all product pages, but since this is my first time using metamod can you please confirm this is correct or if I need to purchase the pro version for it to work.

Joomla! 2.5.8 Stable
VM 2.0.14

*********

if (
$option == 'com_virtuemart' and (JRequest::getVar('view') != 'productdetails') return 125;

*********

Many thanks in advance.

Ino

ino
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Cart on Virtuemart products pages

Hi Ino,

I'd do it this way:

$vm = JomGenius("virtuemart");
if ($vm->check("pagetype = productdetails")) return 125;

You can find out more about the page types that JomGenius knows about here:
http://www.metamodpro.com/jomgenius/parameters#vm2x

You don't need the Pro version.

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

Re: Cart on Virtuemart products pages

Hi Stephen,

Thanks for the reply,

I have input your code into the module and still cant see anything, I am using "Advanced Module Mangager" aswell from NoNumber would that conflict with metamod?

Cheers

Jeff

ino
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Cart on Virtuemart products pages

Hi Jeff,

no, there should be no conflicts with AMM as long as you are using the latest version of both MetaMod and AMM.

1 - the MetaMod must be published, set to ALL pages (or at least some pages), and set to a visible module position.

2 - try setting the MetaMod's debug mode to "advanced" then view the page that you wanted the other module to display on. Do you get any output from the MetaMod? If not, check step 1 again.

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

Re: Cart on Virtuemart products pages

Hi Stephen,

In Advanced Module Manager I have set the MetaMod to ALL pages.
Now I can see the MetaMod Module pulling the assigned module frontend (which is a shopping cart ID:125) but the MetaMod is showing on all pages frontend and not just the VM product pages

This is the debug on a product page:

if (
$option == 'com_virtuemart'
and $view == 'productdetails'
and $Itemid == '160'
and JRequest::getVar('language') == 'it-IT' /*!*/
and JRequest::getVar('lang') == 'it'
and JRequest::getVar('virtuemart_category_id') == '3'
and JRequest::getVar('virtuemart_product_id') == '18'
) return XXX; /* replace XXX with the module ID or position to display */

Now in order to set the module to display on the virtuemart products pages only I guess the following code should work.

if (
$option == 'com_virtuemart'
and $view == 'productdetails'
and $Itemid == NULL
and JRequest::getVar('language') == 'it-IT' /*!*/
and JRequest::getVar('lang') == 'it'
and JRequest::getVar('virtuemart_category_id') == NULL
and JRequest::getVar('virtuemart_product_id') == NULL
) return 125;


Thanks

ino
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Cart on Virtuemart products pages

Hi ino,

the debug output will appear on ALL pages if the MetaMod is set to all pages - but the code you use within the MetaMod can work within that to determine exactly which pages the other module will appear on.

Yes, you could use the code that you quoted. But the original code that I sent should work better (and is less code):

$vm = JomGenius("virtuemart");
if ($vm->check("pagetype = productdetails")) return 125;

Also, pleae note that I released a new version of MetaMod and MetaMod Pro today - please upgrade to the latest version as it has some improvements in VM functionality. Just install the new version over the old one, and you won't lose anything.

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:
10734
Newest User:
gudad2
Members Online:
3
Guests Online:
173


Forum Legend:

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