News:

Support the VirtueMart project and become a member

Main Menu

[Question] Session URL (ItemID) with other modules

Started by Replika, March 03, 2008, 04:28:44 AM

Previous topic - Next topic

Replika

VM auto adds "&Itemid={CURRENT_PAGE}" to the product link.
I assign module 'featuredProduct' to display only on homepage. but because of that Itemid, this module still visible when in product view.

I manually added a line in ps_session that fix Itemid to not equal to Homepage ID.
Any other solutions?

ps: I'm using build 1088. It now hard to update to the latest because of many changes. I also do not like the new language files structure  :(. Why don't take the structure like in Joomla, it easy to manage/manipulate (..but too late now)

[English folder]
-- account.php
-- checking.php
-- shopping.php
...

[Vietnamese folder]
-- account.php
-- checking.php
-- shopping.php
...

gregdev

QuoteI manually added a line in ps_session that fix Itemid to not equal to Homepage ID.
Any other solutions?

Please post the code changes you made so that I can understand what you mean better.

Greg

[tr][td]
[/td][td]
www.plainlycode.com[/td][/tr]
[/table]

Replika

#2
Quote from: gregdev on March 05, 2008, 18:38:34 PM
Please post the code changes you made so that I can understand what you mean better.

In ps_session.php, function url

$Itemid 
"&Itemid=".$this->getShopItemid();


I changed to

$Itemid 
= ($this->getShopItemid() != {MY_HOMEPAGE_ID}) ? "&Itemid=".$this->getShopItemid() : '';


which MY_HOMEPAGE_ID is taken from menu table where `home` = 1

So that, in homepage, all product links do not contain this ItemID, and when user clicks to that, joomla will know that link is not homepage.

xbaez

Thanks a lot, i had the same problem with the itemid but chaged it that i fixed.
My doubt is if there is a variable which contain the HOMEPAGE_ID and get a complete fix for this bug, because in my case i had to add 28 itemid but if i want to change for another itemid the frontpage i will have to change the line again.

Thanks!
Regards!
:)

BernardE

Thanks for this fix. Valid comment by xbaez. However, this is the most logical fix I have seen for this problem. It really seems to me to be the least of a hack, although you'll have to change the HOMEPAGE ID if you change the homepage menu item.

rustyDusty

Will this fix allow me to assign VM modules to my shop page?

At the moment VM modules do not display anywhere on my joomla 1.5 site unless set to "All" in Menu Assignments. This means that I can only see the VM modules on frontpage and can only see them when set to "all". I do not want them on my frontpage. When I assign them to my "Shop" page they vanish. Anyway I updated to v1.1.2 but it did not fix my problem.


Jon Jackson

When I try this fix, I get this error:

Parse error: syntax error, unexpected '{' in /www/my-site/administrator/components/com_virtuemart/classes/ps_session.php on line 497

I am flakey (at least) with php - please help?

Are you sposed to replace the MY_HOMEPAGE_ID bit with the ID number (ie 1) of the main menu Home item?  Tried that too, but still reverts to default (home) template.

Any suggestions please?  will Gladly pay for pro help!