Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Remove modules from VM checkout pages
Remove modules from VM checkout pages
Re: Remove modules from VM checkout pages
Hi Wilhelm,
I hope that a textual description will suffice:
1 - prepare the "target" module by setting it up as usual, but set it to "unpublished". Remember the module ID of this module. (e.g. 123)
2 - create a new MetaMod in the left_top position
3 - in the MetaMod, set Title to Off
4 - leave the "quick module id include" box blank.
5 - use the following PHP, replacing "123" with the actual module id of your target module:
$vm = JomGenius("virtuemart");
if ( ! $vm->check("pagetype startswith checkout") ) return 123;
So what this does, is that without the MetaMod, the module does not display.
Then, because the MetaMod is in the left_top position, it will always check to see what the VM page type is before it decides to include the module "into itself".
So, it checks to see if the page type is one of the checkout steps (startswith checkout). If it is NOT, then the module will be displayed (return 123). The "not" is done with the "!" character above.
Hope that helps,
Stephen
Re: Remove modules from VM checkout pages
Oh, and there's another way to do this if you have MetaMod Pro. It's a little bit cleaner.
1 - set up the target module completely as normal. Keep it published this time.
2 - set up the MetaMod in the same position.
In the MetaMod, use the following code:
$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype startswith checkout") ) {
$changes->mod(123)->disable();
}
(replace 123 with the proper module id of the target module)
What this does is to use the MetaMod to actually disable the other module, rather than including it inside itself (or not).
Note that this ONLY works with MetaMod Pro. MMPro allows you to do this to any other module(s) on the page, whether or not they are inside the MetaMod module.
Cheers,
Stephen
Re: Remove modules from VM checkout pages
Hi Metamodguy. I tried this method ( the second one), and it worked great! Thanks.
However, it only removed the item from the "checkout pages", not from the "Cart overview".
SO, the module is still showing in the first step with the summary of the cart, and is taken away first when you click "go to checkout".
Is there a way to remove it from the cart as well?
Re: Remove modules from VM checkout pages
Tormodnor, what version of Joomla and VM are you using? The names of the page types are a little different in each version.
For Joomla 1.5 & VM 1.x:
$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype startswith checkout, shop.cart") ) {
$changes->mod(123)->disable();
}
For Joomla 2.x & VM 2.x:
$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype startswith checkout, cart") ) {
$changes->mod(123)->disable();
}
Hope that helps,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Remove modules from VM checkout pages
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 2
- User Info:
- Total Users:
- 7658
- Newest User:
- carre82601
- Members Online:
- 0
- Guests Online:
- 202
- 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