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.

 

Error loading modules issue

Error loading modules issue

Hi,

I use metamod with virtuemart to hide the basket when a customer want to order.

But on the shopping cart page the message "error loading modules" appears.

However, the message doesn't appear on every step of the order (doesn't appear on the step SHIPPING ADDRESS).

Here is the code PHP used:

/*Affiche un module sur une ou plusieurs pages Virtuemart, traduction par Alex, Source metamodpro.com*/
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 27; return 27; }
  /* PAGE BROWSE */ if ($page == "shop.browse") { if ($category_id == "2") return 27; return 27; }
  /* PAGE PRODUCT DETAILS */ if ($page == "shop.product_details") { if ($product_id == "4") return 27; if ($product_id == "44") return 27; if ($category_id == "2") return 27; return 27; }
  /* Page "Poser une question sur ce produit" */ if ($page == "shop.ask") return 27;
  /* Page après avoir cliquer sur le bouton commander */ if ($page == "shop.cart") return 1000;
  /* Page recherche avancé */ if ($page == "shop.search") return 27;
  /* Page Compte client virtuemart */ if ($page == "account.index") return 27;
  /* Page Modifier mes adresses d'expédition.    */ if ($page == "account.shipping") return 27;
  /* Page Ajouter une adresse de livraison */ if ($page == "account.shipto") return 27;
  /* Page modifier Information de facturation  */ if ($page == "account.billing") return 27;
  /* page about saved carts */ if ($page == "shop.savedcart") return 27;
  /* Page détail de la commande */ if ($page == "account.order_details") return 27;
  $last_step = JRequest::getVar("checkout_last_step"); /* $ last_step" est: *"" sur la premiere page de paiement (tant que la page est "checkout.index") * 1 sur la page Adresse de livraison, * 2 sur la page Moyen de transport * 3 sur la page

Méthode de paiement * 4 sur la page Passer la commande */

// Maintenant voyons les règles pour : /* checkout, avant ou après la connexion: */ if ($page == "checkout.index" && $last_step == "" ) return 37;
  /* Etape 1 Adresse de livraison */ if ($last_step == 1) return 1000;
  /* Etape 2 Moyen de transport */ if ($last_step == 2) return 1000;
  /* Etape 3 Méthode de paiement */ if ($last_step == 3) return 1000;
  /* Etape 4 Passer la commande */ if ($last_step == 4) return 1000;

}

The id 27 is my mod_virtuemart_cart.
The id 37 is my mod_metamod.

Both modules are in the same place : slidebar A on my template yootheme.

Thank you for your help.

Vinz

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

Re: Error loading modules issue

Hi Vinz,

the reason for the error loading modules is that on the shopping cart page, the code above tells MetaMod to load module 1000. I guess that this module does not exist. The line in the code that's doing this is:

if ($page == "shop.cart") return 1000;

So you can either return a different module number, or remove this line completely if you don't want any module to appear on that page.

The last few lines of your code also have the same problem - they are returning module id 1000 for different steps of the checkout process. You can remove these if you don't want the module to appear there.

So, your re-written rule might look like this:

Code:

/*Affiche un module sur une ou plusieurs pages Virtuemart, traduction par Alex, Source metamodpro.com*/

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 27;
  }
   /* PAGE BROWSE */
  if ($page == "shop.browse") {
    if ($category_id == "2") return 27;
  }
   /* PAGE PRODUCT DETAILS */
  if ($page == "shop.product_details") {
    if ($product_id == "4") return 27;
    if ($product_id == "44") return 27;
    if ($category_id == "2") return 27;
  }
  /* Page "Poser une question sur ce produit" */
  if ($page == "shop.ask") return 27;

  /* Page recherche avancé */
  if ($page == "shop.search") return 27;

  /* Page Compte client virtuemart */
  if ($page == "account.index") return 27;

  /* Page Modifier mes adresses d'expédition. */
  if ($page == "account.shipping") return 27;

  /* Page Ajouter une adresse de livraison */
  if ($page == "account.shipto") return 27;

  /* Page modifier Information de facturation */
  if ($page == "account.billing") return 27;

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

  /* Page détail de la commande */
  if ($page == "account.order_details") return 27;

  $last_step = JRequest::getVar("checkout_last_step");
  /* $ last_step" est:
   *"" sur la premiere page de paiement (tant que la page est "checkout.index")
   * 1 sur la page Adresse de livraison,
   * 2 sur la page Moyen de transport
   * 3 sur la page Méthode de paiement
   * 4 sur la page Passer la commande */

  /* Maintenant voyons les règles pour :
   * checkout, avant ou après la connexion: */
  if ($page == "checkout.index" && $last_step == "" ) return 37;
}

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: Error loading modules issue

Thank you VERY much for your help.

Vinz

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

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5534
Newest User:
kaylee
Members Online:
0
Guests Online:
135

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