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.

 

[solved] One page checkout. Can't hide module

[solved] One page checkout. Can't hide module

Hi!

I have bought a MetaModPro.
I have installed the free metamod aswell but I have unpublished it and it has no code in it.

I am trying to hide a module in a one page checkout cart. (modulename = Webbbutiken)
I have tried several methods but I cannot get it to work.

I am using the following:
Joomla 2.5.18
MetaMod v3.15

Template In virtumart is ygk_Horme

Bought a onepagecheckout plugin:
VP One Page Checkout(Ver 1.9)
http://www.virtueplanet.com/vp-one-page-checkout-detailhttp://www.virtueplanet.com/vp-one-page-checkout-detail

The site I am working on:
www.hermodsacademy.se 

Using recipe:
$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.product_details, shop.cart") ) {
  $changes->mod( 92 )->disable();
}

Value 92 is the id of the module I want to hide.

what I am after is hiding module position sidebar-a if possible. Otherwise I'm happy just being able to disable ID 92 module (Webbutiken) When visiting the one page checkout cart.

Please help me.

Regards,

Janeric

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] One page checkout. Can't hide module

Hi Janeric,

Because the OPC changes the way that the checkout pages are laid out, it's possible (likely) that JomGenius can't pick up the page as being one of the standard pages. Could I suggest that you turn on MetaMod's "advanced debug" mode, and visit the OPC page. Then you should see in the MetaMod output some PHP code. Can you copy and paste that code into the forum here, then I can edit that and give you some code that should work.

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

Re: [solved] One page checkout. Can't hide module

if (
$option == 'com_virtuemart'
and $view == 'cart'
and $Itemid == '105'
and $jinput->get('keyword') == '' /*!*/
and $jinput->get('filter_product') == '' /*!*/
and $jinput->get('limit') == 'int' /*!*/
and $jinput->get('limitstart') == '0' /*!*/
and $jinput->get('format') == 'html' /*!*/
) return XXX; /* replace XXX with the module ID or position to display */
Note: lines starting with "and" and ending with /*!*/ contain rules that may be optional. You may wish to leave them out.
MetaMod debug info:
Module ID: 103
$option: com_virtuemart
$view: cart
$id:
$Itemid: 105
$timezone: Europe/Stockholm
$language: en-us
$language_code: en
$language_region: us
page type: cart
Including modules: Ingen

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] One page checkout. Can't hide module

Sorry I forgot to say that when I use this code:

$vm = JomGenius("virtuemart");
if ( $vm->check("pagetype = shop.product_details, shop.cart") ) {
  $changes->mod( 92 )->disable();
}


The module is hidden BUT then it becomes hidden on all pages..

regards,

Janeric

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] One page checkout. Can't hide module

Sorry for multiple posts but I use

return 92;

in metamod php box to show the module. Otherwise It is hidden.

regards,

Janeric

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] One page checkout. Can't hide module

when in the module "Webbutiken" (Id 92) and if I assign it to all pages then I see two "webbutiken".

Sorry for all the posts.
Kinda frantic since I am going to use this website in a meeting later today..
Hope it helps.

Regards

Janeric

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] One page checkout. Can't hide module

Hi Janeric,

Sorry I am in a time zone on the other side of the world... getting to this as quickly as I can.

You need to follow the instructions on the Quick Start guide, http://www.metamodpro.com/metamod/quick-start

In particular:
1 - you need to disable the target module so it does not show on any pages. e.g. by setting it to "menu items: none". That way it won't show up unless MetaMod includes it.
2 - there's no need to use the "disable" technique and the "return 92;" technique in the same rule. Just use one or the other. In this case I'd suggest using some PHP to detect the page that you DON'T want it to display on, then show it on every OTHER page.

e.g.

$show = true;
if (  $option == 'com_virtuemart'
  and $view == 'cart'
)  $show = false;
if ($show) return 92;

I think that should work for you, as long as module 92 is set to "menu items: none" so it does not show up until MetaMod includes it.

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

Re: [solved] One page checkout. Can't hide module

Hi Stephen,

I will try to implement that tomorrow since I am busy with multiple projects..

Many thanks for the fast response smile

Regards

Janeric

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] One page checkout. Can't hide module

Hi Stephen,

I haven't been able to test your sulution until today.
It works great now thank you!

Regards,

Janeric

janeric
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Total Posts Today:
1
User Info:
 
Total Users:
10075
Newest User:
rsker57
Members Online:
0
Guests Online:
246

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