Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Cart on Virtuemart products pages
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
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
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
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
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
- Index
- » MetaMod
- » MetaMod General Support
- » Cart on Virtuemart products pages
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 1
- Guests Online:
- 133
- Online:
- uistr4qx
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked