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.

 

Hide modules at Checkout in Virtuemart

Hide modules at Checkout in Virtuemart

Hi guys,

i am trying to hide modules from checkout process in vm, i tested some of samples but with no luck, is there someone to help me?
Thanks!

Edited By: lemon1
09-Sep-10 12:52:02

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

Re: Hide modules at Checkout in Virtuemart

I helped out someone with this the other day. Here are the steps I took. There are various ways of doing this, but this is a good one:

1 - move each of the modules that are appearing in the checkout into a new module position. e.g. anything that was in "right", change to "right-non-vm". You can just type these new position names into the dropdown list of module positions, when you are editing each module. (yes, you can just type a new value in there even though it looks like a dropdown).

2 - for each of the original module positions concerned (e.g. right, left, top), create a new MetaMod. I name them according to the module position they are in.

So I have a new one in the "right" position that I call "Right for non-vm"; in the "left" position I have one called "Left for non-vm".

3 - in each of the MetaMods, use the following rule:

$vm = JomGenius("virtuemart");
if ($vm->check("pagetype not starts with checkout") ) return "right-non-vm";

(you'll need to change the "right-non-vm" to the appropriate one for the MetaMod you're editing. if it's in the left position, change it to "left-non-vm")

So you'll end up with a MetaMod in the "left" position with this:
$vm = JomGenius("virtuemart");
if ($vm->check("pagetype not starts with checkout") ) return "left-non-vm";

... and in the right position with this:
$vm = JomGenius("virtuemart");
if ($vm->check("pagetype not starts with checkout") ) return "right-non-vm";

... and so on.


Now it should just work.

How does it work?
- each time a page is requested, the MetaMod modules will be "run". They check to see if the page type starts with "checkout" (e.g. checkout.index etc). If NOT, then they tell MetaMod to insert all the modules from the "left-non-vm" position.
- in this way, it's easy to add new modules into your site in the left and right positions - just put them into "left" if they should appear in the VM checkout, and "left-non-vm" if they should not.

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

Board Info

Board Stats:
 
Total Topics:
1689
Total Polls:
6
Total Posts:
5941
Posts this week:
1
User Info:
 
Total Users:
5355
Newest User:
titus87954
Members Online:
3
Guests Online:
118


Forum Legend:

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