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.

 

Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

Kudos by the way on a great extension!smile  Other than a slight technical difficulty I am having this is a great tool.

To summarize, I am having redirect issues with Joomla virtuemart menuitems shortly after publishing my metamod module. To bring you up to speed, I ran the debug tool in the metamod extension to document the page identification.  My website is http://www.test.ilovefans.com/.

Fyi...I copied each page identification and edited the corrections of what the item id's should be in relation to the product and cat ids.  (See below.)

Any idea why this onset virtuemart menuitem issue is occuring?

Your direction is greatly appreciated.

/* Online Store */
if (
   $option == 'com_virtuemart'
   and $Itemid == '115'
) return XXX; /* replace XXX with the module ID or position to display */

/* Ceiling Fans */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 6
   and $Itemid == '102'
) return XXX; /* replace XXX with the module ID or position to display */

/* Indoor Ceiling Fans */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 18
   and $Itemid == '104'
) return XXX; /* replace XXX with the module ID or position to display */

/* 19th Century */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.product_details'
   and JRequest::getVar('category_id') == 18
   and $Itemid == '105'
   and JRequest::getVar('product_id') == 152
   and JRequest::getVar('flypage') == 'vmj_color_plus.tpl'
) return XXX; /* replace XXX with the module ID or position to display */

/* Academy */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.product_details'
   and JRequest::getVar('category_id') == 18
   and $Itemid == '106'
   and JRequest::getVar('product_id') == 221
   and JRequest::getVar('flypage') == 'vmj_color_plus.tpl'
) return XXX; /* replace XXX with the module ID or position to display */

/* Outdoor Ceiling Fans */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 19
   and $Itemid == '107'
) return XXX; /* replace XXX with the module ID or position to display */

/* Portable Fans */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 20
   and $Itemid == '108'
) return XXX; /* replace XXX with the module ID or position to display */

/* Fan Accessories */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 21
   and $Itemid == '109'
) return XXX; /* replace XXX with the module ID or position to display */

/* Fan Blades */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 22
   and $Itemid == '110'
) return XXX; /* replace XXX with the module ID or position to display */

/* Light Fixtures */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 24
   and $Itemid == '111'
) return XXX; /* replace XXX with the module ID or position to display */

/* Casablanca KG99 Fan Light Kit  */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.product_details'
   and JRequest::getVar('category_id') == 24
   and $Itemid == '116'
   and JRequest::getVar('product_id') == 248
   and JRequest::getVar('flypage') == 'vmj_color_plus.tpl'
) return XXX; /* replace XXX with the module ID or position to display */

/* View All Ceiling Fans  */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.browse'
   and JRequest::getVar('category_id') == 23
   and $Itemid == '112'
) return XXX; /* replace XXX with the module ID or position to display */

/* 19th Century */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.product_details'
   and JRequest::getVar('category_id') == 23
   and $Itemid == '113'
   and JRequest::getVar('product_id') == 152
   and JRequest::getVar('flypage') == 'vmj_color_plus.tpl'
) return XXX; /* replace XXX with the module ID or position to display */

/* Academy */
if (
   $option == 'com_virtuemart'
   and JRequest::getVar('page') == 'shop.product_details'
   and JRequest::getVar('category_id') == 23
   and $Itemid == '114'
   and JRequest::getVar('product_id') == 221
   and JRequest::getVar('flypage') == 'vmj_color_plus.tpl'
) return XXX; /* replace XXX with the module ID or position to display */

 


My website at http://www.test.ilovefans.com/ and click on "online store

rickyes
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

Hi rickyes,

you haven't really explained what the problem is, so I don't know what I am looking for.

I see however that the Itemids of the links in your main menu are different from the Itemids that you are checking for in the PHP code. In many cases in VirtueMart it's best to leave out the checks for Itemid altogether, as VM often confuses the Itemids. Perhaps that's your problem?

So just leave out the lines that say "and $Itemid == 'nnn'" and see if that helps.

One last thing: the very first rule that you are using will actually catch ALL virtuemart pages, and will prevent MetaMod from getting to any of the other rules. I'd either leave it out for now, or change it to this:

if ($option == "com_virtuemart"
  and JRequest::getVar("page") == null
  and $Itemid == 115 /* keep this line in, in this case */
) return XXX;

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: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

See Below...

rickyes
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

I deleted all my virtuemart menu items to get rid of "item id's" as per your recommendation as I understood it.

Given this new direction...I am using your recipes listed in the "How To Recipe" section and nothing is wokring for me.

I want to include modules to my virtuemart categories and products but I am not having luck.  The way I got it to work before, in the MetaMod Module I selected the virtuemart menu item id in the menu assignment selection bar, tied in my joomla module.  I simultaneously included the recipe suggestions in the PHP field and Voila! That worked.  However, I then had to contend with my Virtuemart menuitem pathway dilemna.

I understand you do not need to select a menu in the menu assignment section and only use PHP.  That method is not working for me.  Any direction would be greatly appreciated.  I covered your FAQ's, Quick Start Up, etc. but still have not figured this out. 

If you could give me a recipe to get me started I would really appreciate it.

Cheers!

rickyes
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

After messing with my problem over the weekend...I believe I pegged a solution.  I removed the virtuemart menu items as per your recommendation...eliminating the item ids for virtuemart categories and product items with the exception of one item.  (Item 29)

Another change I made today that I was doing differently before...I selected "All" menu items in the MetaMod Module Menu Assignment this time as opposed to none. Moreover, in the PHP field I included the recipe suggested in your Virtuemart How To recipes.

It finally worked.  Again, your module is awesome!  Thank you.

Could you elaborate a little more on your last post about omitting the very first rule I used previously.  Something about the rule will actually catch ALL virtuemart pages.

FYI...I am using the following recipe:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( $vm->check("pagetype = shop.browse") ) {
  $category_id = $vm->info( "category_id" );
  /* when browsing a specific category on browse page (e.g. category 2) */
  if ($category_id == "18") return 93; /* module WWW for category 2 */
  if ($category_id == "19") return 93; /* module XXX for category 3 */
  if ($category_id == "23") return 93; /* module YYY for category 4 */

 
}

Is this correct for my application?

Please advise.

Regards,

Richard

rickyes
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

Hi Richard,

1 - yes, it's important that the MetaMod module is assigned to some menu items - either the exact ones that are applicable, or (especially for VM), to ALL pages. That's because of VM's Itemid hell. It's only the "target" modules (the ones that you want to include) that you need to set to "none" menu items.

2 - The PHP code in your last post looks perfect, no problems there.

3 - When I mentioned about omitting the 1st rule, that's because the 1st rule was this:

if (
   $option == 'com_virtuemart'
   and $Itemid == '115'
) return XXX; /* replace XXX with the module ID or position to display */


The problem with that is that it would catch all VM pages with Itemid (menu id) 115, not only the "front page" view. As soon as MetaMod hits a "return" statement, it doesn't read any further down your list of rules, so having that rule at the top was likely to cause other problems. In any case, it looks like you're doing without it, so that's bypassing that particular problem.

4 - Personally I think that using hidden menu items tied to VM categories, simply in order to be able to put modules onto category pages, is a recipe for disaster. That's because VM modules that display list of items tend to get very confused about which Itemid (i.e. menu item) they should point to. MetaMod, using the type of code you're using above, is a much more direct way of tying modules to particular VM categories, because it knows the actual category of the item being displayed, and does not have to deduce it from the menu item, which in many cases is incorrect.
So I completely agree with your decision to remove all the menu items for the different VM categories.

Hope that clarifies things,
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: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

Yes sir...thanks again:)

rickyes
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Virtuemart-menuitem Id's vs.Product Id's redirect issues post install

And by the way, "If you use MetaMod, please post a rating and a review at the Joomla! Extensions Directory"

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

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5940
Total Posts Today:
1
User Info:
 
Total Users:
5186
Newest User:
Totosite
Members Online:
0
Guests Online:
158

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