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.

 

Remove modules from VM checkout pages

Remove modules from VM checkout pages

Please would you send me a screen shot with settings for "Remove modules from VM checkout pages" for modulpositionon for example, "left_top"?
regards
Wilhelm

Edited By: Wilhelm1983
17-Dec-10 22:13:29

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

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

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

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

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

Re: Remove modules from VM checkout pages

Thank you, I have now understood!
Regards
Wilhelm

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

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?

Tormodnor
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

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

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

Board Info

Board Stats:
 
Total Topics:
1696
Total Polls:
6
Total Posts:
5941
Posts this week:
8
User Info:
 
Total Users:
5378
Newest User:
gary9131
Members Online:
0
Guests Online:
188

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