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.

 

To disable modules on some pages Virutemart

To disable modules on some pages Virutemart

hi guys,
Unfortunately I can not run the module as I would like.
I wish that the modules 70 and 71 (left position), see in all the pages of the site, except in the pages of virtuemart shop.cart and checkout.

I put this code but the modules can be seen in every page of the site:

if ($page != "checkout.index" && $last_step == "" ) return 70;
if ($page != "checkout.index" && $last_step == "" ) return 71;
if ($page != "shop.cart") return 70;
if ($page != "shop.cart") return 71;

I hope someone can help me.

fine thanks.

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

Re: To disable modules on some pages Virutemart

Hi Goldlink,

it looks like you just picked some code out of the recipe for determining the VM page that you are on.

Close, but you needed to use a few other lines as well!

Basically, you need the code for generating the "$page" and "$last_step" variables.  Also, if you want to return 2 different modules at the same time, you put them both together like this:   return "70,71";

So try this as your code:

Code:

/* first, always return them both on any page that's not a virtuemart page */

if ($option != 'com_virtuemart') return "70,71";
/* now, since we know we're on Virtuemart, check the exact pages */
$page = JRequest::getVar('page');
/* if we're not on the cart page or any of the checkout pages, return our modules */
if ($page != "shop.cart" and $page != "checkout.index" ) return "70,71";

In this case we didn't actually need to deal with "last_step", because all pages that have the "checkout_last_step" parameter also have $page == "checkout.index", so we just check for that.

Hope that does what you want it to smile

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

Re: To disable modules on some pages Virutemart

Thanks a lot, works perfectly!

Unfortunately I had to ask for your help... I always try to find the solution in other post, but until I will not understand how metamod works, you will bear me! big_smilebig_smilebig_smile

Thanks again and good work.

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

Re: To disable modules on some pages Virutemart

Hey that's no problem. Everyone's situation is slightly different and some tweaks are often needed. That's the beauty of MetaMod... you're not forced into a "1 size fits all" setup and a rule can be made for just about any situation.

Glad it's working for you,
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
3314 Posts
User info in posts
Administrator has disabled public posting

Re: To disable modules on some pages Virutemart

Hi..
Im new to MetaMod.
Just installed it and saw a lot of options.
Dint understand any of it.
Just entered this code from above,
/* first, always return them both on any page that's not a virtuemart page */

if ($option != 'com_virtuemart') return "70,71";

/* now, since we know we're on Virtuemart, check the exact pages */

$page = JRequest::getVar('page');

/* if we're not on the cart page or any of the checkout pages, return our modules */

if ($page != "shop.cart" and $page != "checkout.index" ) return "70,71";


And placed it.

But no changed.

In place of 70,71 , I just placed my module id of 106 .
Not sure, what am I missing.

soamz
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: To disable modules on some pages Virutemart

[note: followed this up on another thread, and solved it a different way]

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

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
Members Online:
0
Guests Online:
104

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