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 ALL modules on virtuemart checkout

Hide ALL modules on virtuemart checkout

Hello,

Id like to hide all my modules on the virtuemart cart and checkout pages but have them show on all other pages, is this possible with metamod ?

Following your virtuemart recipe here http://www.metamodpro.com/metamod/recip … mart-pages i've managed to hide a module on all pages except the virtuemart checkout but i need to do the complete opposite to this.

Any help would be greatly appreciated.

Regards,
Mark

gfxpixeldesigns
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Hide ALL modules on virtuemart checkout

Hi Mark,

to save me guessing, can you post what your current rule is, then I'll show you how to "negate" it to do the opposite of what it currently does?

Thanks,
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: Hide ALL modules on virtuemart checkout

Hi Stephen,

Thanks for your reply.

The rule im using is the very bottom one on the recipe link above:

Code:


if ($option == "com_virtuemart") {
$page = JRequest::getVar("page");
$category_id = JRequest::getVar("category_id");
$product_id = JRequest::getVar("product_id");
$search_category = JRequest::getVar("search_category");
if ($search_category != "") {
  if ($search_category == 1) return 95; /* searched for a specific category */
  return 96; /*searched on any other category */
}

/* BROWSE page */
if ($page == "shop.browse") {
  /* when browsing a specific category on browse page (e.g. category 2) */
  if ($category_id == "2") return 97;

  /* when browsing any other category on browse page */
  return 98;
}

/* PRODUCT DETAILS page */
if ($page == "shop.product_details") {
  /* modules that should appear for specific products */
  if ($product_id == "4") return 99;
  if ($product_id == "44") return 100;

  /* when viewing a product in a specific category (2 in this case).
   * Doesn't always show up unfortunately: */
  if ($category_id == "2") return 101;
  return 102; /* when viewing any other product not mentioned above */
}

/* "ask a question about this product" page */
if ($page == "shop.ask") return 103;

/* viewing shopping cart page */
if ($page == "shop.cart") return 104;

/* advanced search page */
if ($page == "shop.search") return 1041;

/* customer account page */
if ($page == "account.index") return 1042;

/* cutomer account shipping address page */
if ($page == "account.shipping") return 1043;

/* customer account add shipping address page */
if ($page == "account.shipto") return 1044;

/* customer account billing info page */
if ($page == "account.billing") return 1045;

/* page about saved carts */
if ($page == "shop.savedcart") return 1046;

/* order details page */
if ($page == "account.order_details") return 1047;

$last_step = JRequest::getVar("checkout_last_step");
/* $last_step is:
  * "" on the first checkout page (as long as page is "checkout.index")
  * 1 on the page for shipping method,
  * 2 on the page for taking the credit card number
  * 3 on the page for reviewing the order
  * 4 on the page for confirming the order
  */

// now some more possible rules:
/* checkout, before or after login: */
if ($page == "checkout.index" && $last_step == "" ) return 105;

/* for selecting shipping method */
if ($last_step == 1) return 106;

/* page for taking the credit card number */
if ($last_step == 2) return 107;

/* page for reviewing the order */
if ($last_step == 3) return 108;

/* page for confirming the order */
if ($last_step == 4) return 109;

}
// END OF VIRTUEMART RULES

I need this to do the opposite - to show on all pages except the virtuemart checkout pages, and i need all modules to do this.

Thanks

gfxpixeldesigns
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Hide ALL modules on virtuemart checkout

HI gfxpixeldesigns,

ok, we can do without most of that rule.

You will need to create a MetaMod for each module position on your page that has modules published in it. Then, this rule will selectively include those modules, but only when it detects that it is not on a VirtueMart checkout or cart page.

Each of the "target" modules will need to be set to display on "none" pages, or disabled. I guess you already know about that since you got it partially working already.

Code:

$remove = false;

if ( $option == "com_virtuemart" ) {
  $page = JRequest::getVar("page");
  if ($page == "shop.cart") $remove = true;
  if ($page == "checkout.index") $remove = true;
}
// replace XXX, YYY, ZZZ with the modules to be shown in this position
if ($remove == false) return "XXX,YYY,ZZZ";

So if you have modules 40, 41 and 42 in the left module position, and 50 and 51 in a right module position, then:

1 - disable all those modules
2 - create a MetaMod and place it into the left module position for "ALL" pages. Use the complete PHP rule above.
3 - in that MetaMod, edit that last line to this:

if ($remove == false) return "40,41,42";

4 - create another MetaMod and place it into the right module position for "ALL" pages. Use the complete PHP rule above.
5 - in that MetaMod, edit that last line to this:

if ($remove == false) return "50,51";

I think that will do what you want it to.

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
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:
7
User Info:
 
Total Users:
5418
Newest User:
outsd2
Members Online:
0
Guests Online:
129

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