Author Topic: $Itemid problem with mainmenu  (Read 52047 times)

Lylene

  • Jr. Member
  • **
  • Posts: 118
Re: $Itemid problem with mainmenu
« Reply #15 on: December 18, 2008, 22:07:40 pm »
Sorry to bother but another question comes out following the amendment I made (MiRcOv post). I have breadcrumbs for items that are not part of the menu. However, for these, breadcrumbs are not working. See example below:
Breadcrumbs are displayed for:
- Menu01
- Menu02
- Module (TopTen)
Let's say I have one item common to all the Menu/Modules listed above ITEM01 (CAT01/MENU01) (which is obvious)

If I am on homepage, breadcrumbs of the product page will be Home / MENU01/CAT01/ITEM01 =>OK

If I am on Menu01, breadcrumbs of the product page will be Home / MENU01/CAT01/ITEM01 =>OK

If I am on Menu02, breadcrumbs of the product page will be Home/MENU02/CAT01/ITEM01 => WRONG

Does anyone know how to correct this ?

Also, I have the same problem with VM Cart Module : Instead of displaying Home / My Cart, the breadcrumbs display Home / Menu01 / My Cart if I was on Menu01 already.

Thansk for your help,

loiseau

  • Beginner
  • *
  • Posts: 31
Re: $Itemid problem with mainmenu
« Reply #16 on: December 21, 2008, 18:57:51 pm »
The itemid problem make me crazy !
I've got new problems in my sitemap (sef_servicemap 2.0.10), in the related products, in the latest products ...
cause problems in indexation of my website in Google ... etc ... etc ...
??? PLEASE, can we have more informations ? or a REAL correction of this bug ?
Hope to fix this bug in the next (soon?) version of Virtuemart !
Many thanks !
Regards.
:-\ :'(

pagehosting4u

  • Beginner
  • *
  • Posts: 5
Re: $Itemid problem with mainmenu
« Reply #17 on: January 10, 2009, 19:59:17 pm »
Setup:
Joomla 1.5.8
VirtueMart 1.1.2

I was able to use the info here to fix the itemid issue with the mainmenu, but the problem is throughout all modules. If I click on an item in the scrolling module, all products get itemid=xx added to the end of the urls. Where xx is the first product I added. If I click on a category, all products have itemid=xx added to the end of the urls. It amazes me that this post started over 6 months ago and this is still a problem. Please fix it.

Micha

  • Jr. Member
  • **
  • Posts: 71
Re: $Itemid problem with mainmenu
« Reply #18 on: January 10, 2009, 22:19:36 pm »
Hi Joomlers,

I have also the same problem and i tried to implement the hack also but i see a error on mij front-end. I do not know exact what it was so i post that again. I use Joom 1.5.8 and VM 1.1.2

Hope a real solution get soon.

Micha

Update: modified the file for second time and it works! Menu is now expand good. ::)

loiseau

  • Beginner
  • *
  • Posts: 31
Re: $Itemid problem with mainmenu
« Reply #19 on: January 11, 2009, 01:57:32 am »
Hi

You can see in the Virtuemart news :
"Also an important maintenance release - VirtueMart 1.1.3 - is currently being prepared for release (next week), so stay tuned."

I hope a great fix for this bad bug !!!

Soeren

  • Administrator
  • Sr. Member
  • *
  • Posts: 3106
  • VirtueMart Starter
    • virtuemart.net
Re: $Itemid problem with mainmenu
« Reply #20 on: January 11, 2009, 13:25:17 pm »
Hi,
I don't think this is a bug. It won't be "fixed" in VM 1.1.3. Itemid handling in Joomla! sucks, sorry.

ciao, sören
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

loiseau

  • Beginner
  • *
  • Posts: 31
Re: $Itemid problem with mainmenu
« Reply #21 on: January 11, 2009, 13:47:44 pm »
Hi,
I don't think this is a bug. It won't be "fixed" in VM 1.1.3. Itemid handling in Joomla! sucks, sorry.
ciao, sören

Really ? I'm confused. I believed that this bug was in virtuemart...
We have to declare this bug to the joomla squad  ...

Sorry Sören.

ILJ

  • Beginner
  • *
  • Posts: 41
Re: $Itemid problem with mainmenu
« Reply #22 on: January 11, 2009, 14:41:51 pm »
Hi there

i went crazy with this problem now got some hints.
thank god.
is this virtuemart bug or joomla?
if Joomla we can forget abt it. cause 1.0 is over the support phase.

pls vm developers help us till we find an alternative.

thanks
ILJ

pagehosting4u

  • Beginner
  • *
  • Posts: 5
Re: $Itemid problem with mainmenu
« Reply #23 on: January 12, 2009, 22:25:28 pm »
Hi,
I don't think this is a bug. It won't be "fixed" in VM 1.1.3. Itemid handling in Joomla! sucks, sorry.
ciao, sören
I am sorry to hear this. The problem seems to me to be VirtueMart not properly handling the Itemid. The VirtueMart menu item does not work in the main menu. ie, it doesn't matter what I put in for Flypage or Page, they don't get placed in the url that is created for the menu item. I had to go in and manually create all my menu items as external links.

Now that my main menu is working, the product scroll is not working. If I am browsing a product that has Itemid=57, then all products in product scroll module has Itemid=57 added to their urls. Therefore, when you click on a product, the product's details are shown, but there is a chance the wrong menu category is highlighted in the main menu. You can view the site I am working on here, http://74.53.203.210/~canary/

Another issue is with the VM extended search. If you follow this link, http://74.53.203.210/~canary/index.php?searchword=Sondra+Lewis&ordering=&searchphrase=all&option=com_search , you will see that all VM products listed in the search have "Candida and food allergy" as its product's category, when that is not true for the first item "Simple Choices..." What I do see is the WRONG category for the product followed by the correct category for the product. The urls also have Itemid=57 added to all of them. BTW, Itemid=57 just happens to be the very first item/category that I created in VM once I installed it.

Please take another look as it seems to me that all that is missing is the correct conditional checking for Itemid.
Thanks for a wonderful component.
Rick

PS. Once again, here is my setup:
Joomla 1.5.8
VirtueMart 1.1.2

Soeren

  • Administrator
  • Sr. Member
  • *
  • Posts: 3106
  • VirtueMart Starter
    • virtuemart.net
Re: $Itemid problem with mainmenu
« Reply #24 on: January 13, 2009, 07:06:17 am »
Quote
BTW, Itemid=57 just happens to be the very first item/category that I created in VM once I installed it.

Try to delete that item from the main menu and try again.

ciao, Sören
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

pagehosting4u

  • Beginner
  • *
  • Posts: 5
Re: $Itemid problem with mainmenu
« Reply #25 on: January 13, 2009, 16:05:47 pm »
I deleted the menu item Candida and Food Allergy and tried again. For the parameters I placed 7 in for the category ID and shop.browse for the page. It now appears that it is ignoring the parameters. If you go here, http://74.53.203.210/~canary/ and click on the menu item for Candida and Food Allergy, it does not take me to that page. It takes me to the default home page for VirtueMart as if I had just gone to http://74.53.203.210/~canary/index.php?option=com_virtuemart.
Anymore suggestions?

How do I remove the ItemID parameter off of the url links in the scrolling products window? I tried looking in the plugins folder and removing ItemID from the vmxsearch.plugin.php file, but no such luck.

Thanks for your help.
Rick

pagehosting4u

  • Beginner
  • *
  • Posts: 5
Re: $Itemid problem with mainmenu
« Reply #26 on: January 13, 2009, 16:44:17 pm »
OK, this fix actually breaks the MainMenu and the VM Extended Search Plugin, I can't remember where I found it, but it has to with modifying components\com_virtuemart\virtuemart_parser.php
Code: [Select]
// Get the menu parameters, if any
if( vmIsJoomla( '1.5' ) ) {
$menu =& JMenu::getInstance('site');       // Added
$menuparams =& $menu->getParams($Itemid);  // Added
//$menuparams = $mainframe->getParams();
It now looks like MainMenu is now at least recognizing the category parameter, but seems to ignore the Flypage and Page parameters.

And the scrolling products still attached the Itemid of the current page that is showing. It would be nice if I could just remove the Itemid. I would rather have no menu item highlighted when selecting a product from the scrolling product module than have the wrong menu item highlighted.
Thanks for any help someone could give me.
Rick

loiseau

  • Beginner
  • *
  • Posts: 31
Re: $Itemid problem with mainmenu
« Reply #27 on: January 17, 2009, 13:38:52 pm »

jingtian

  • Beginner
  • *
  • Posts: 26
Re: $Itemid problem with mainmenu
« Reply #28 on: January 19, 2009, 08:22:43 am »
info: Joomla 1.5.7 + VM 1.1.2
*I also resolve this:
in administrator/components/com_virtuemart/classes/ps_session.php
*find:
if( !defined( '_VM_IS_BACKEND' )) {
$Itemid = "&Itemid=".$this->getShopItemid();
*after:
"&Itemid="
*write some number:
"&Itemid=22"
*Save and exit ;D

if u checkout, you will find the itemid for "continue shopping" is different . u will then not be able to load the correct itemid.

FatalMusic

  • Jr. Member
  • **
  • Posts: 55
Re: $Itemid problem with mainmenu
« Reply #29 on: January 22, 2009, 14:55:55 pm »
The hack of vm-expert works. I figured out where to put it and tested it and it works :)


Open:

1. administrator/components/com_virtuemart/classes/ps_session.php

2. go to +/- line 497 where it says: $Itemid = "&Itemid=".$this->getShopItemid();

3. REPLACE THIS LINE with their code:

// Original Virtuemart Code:
// $Itemid = "&Itemid=".$this->getShopItemid();
// VM-Expert Hack – Start
if(!strpos($text, "category_id="===false)) {
parse_str(str_replace("amp;","",$text),$tk_arr);
if($tk_catid=intval($tk_arr['category_id'])) {
$db = new ps_DB;
$db->query("SELECT id from #__menu where link like '%option=com_virtuemart%' and params like '%category_id=$tk_catid%' and published=1");
if( $db->next_record() ) $result = $db->f("id");
/*
The same with Joomla-DB-Class: $db =& JFactory::getDBO();
$db->setQuery("SELECT id from #__menu where link like '%option=com_virtuemart%' and params like '%category_id=$tk_catid%' and published=1");
$result=$db->loadResult();
*/
if ($result) $tk_itemid=$result;
}
}
$Itemid = "&Itemid=" . ($tk_itemid ? $tk_itemid : $this->getShopItemid());
// VM-Expert Hack - End



et voila! :)