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.

 

Module issues with Virtuemart

Re: Module issues with Virtuemart

Hi Stephen,

Thanks for sticking with me on this.

I've done as you suggested,put that echo line into the script, and you guessed it, it does print the message "We are on category 6" etc when in debug mode, even though no modules are being output.

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: Module issues with Virtuemart

I just can't understand what's going on - you can echo a value, but when you do an "if" statement it appears that it's not there? And only for one type of page?

I'm clutching at straws now. Perhaps there's a problem with strings vs integers. Try this:

$vm = JomGenius("virtuemart");
if ($vm and $vm->check("pagetype = shop.product_details, shop.browse") ) {
  $cat = (int)$vm->info("categoryid"); // <- only difference is in this line (int)
  if ($cat == 6) return 49;
  if ($cat == 12) return 53;
  if ($cat == 18) return 54;
  if ($cat == 24) return 55;
  if ($cat == 30) return 56;
}

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

Re: Module issues with Virtuemart

Hi Stephen,

I've tried as suggested but that amended piece of code hasn't helped either. I'm still failing to get any of those mods on the product details pages :-(

Q.

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: Module issues with Virtuemart

I'm stumped. Any chance I can log in to your site as an admin and work on it from there? Just send me a PM with a login...
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Module issues with Virtuemart

Finally, got it!!! Thanks for the login.

Here's what was going on: the main "category" pages were supposedly (e.g.) category 6 -- but in fact the items listed on the page all had different categories - from 7 to 10. You were checking for category "6" in order to display the appropriate banner, which was fine on the main page. But when you click through to view the product details of one of those items, that item was actually in a different category, so the top level banner didn't show.

So it's just about nested categories.

In JomGenius, the $vm->check("categoryid = ...") code only checks the immediate category that the product (or category page) is in. It doesn't check the parent category or any of the ancestor categories.

However, the good news is that the $vm object *can* get hold of that information. It's not documented yet, and in the next release it's going to go into the check("...") method. But for now you can do it like this:

$vm = JomGenius("virtuemart");
if ($vm and $vm->check("pagetype = shop.product_details, shop.browse") ) {
  $cat = $vm->categoryId("top");
  if ($cat == 6) return 49;
  if ($cat == 12) return 53;
  if ($cat == 18) return 54;
  if ($cat == 24) return 55;
  if ($cat == 30) return 56;
}

The method is this: $vm->categoryId("top");
This brings back the "top" level category id, as opposed to $vm->info("categoryid") which brings back the "bottom" level category id (i.e. the immediate category that the product is in).

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

Re: Module issues with Virtuemart

Stephen, I can't thank you enough for solving this issue. I feel a little foolish that I didn't realise what was going on re the nested categories ! Once again you have shown great commitment and support. I really do appreciate it. Thanks again. Q.

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1689
Total Polls:
6
Total Posts:
5933
Posts this week:
4
User Info:
 
Total Users:
4752
Newest User:
wrfam2
Members Online:
1
Guests Online:
124

Online: 
wrfam2

Forum Legend:

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