Author Topic: [Question] Session URL (ItemID) with other modules  (Read 6193 times)

Replika

  • Beginner
  • *
  • Posts: 39
[Question] Session URL (ItemID) with other modules
« on: March 03, 2008, 04:28:44 am »
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)

Code: [Select]
[English folder]
-- account.php
-- checking.php
-- shopping.php
...

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

gregdev

  • Full Member
  • ***
  • Posts: 968
    • PlainlyCode
Re: [Question] Session URL (ItemID) with other modules
« Reply #1 on: March 05, 2008, 18:38:34 pm »
Quote
I 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

Replika

  • Beginner
  • *
  • Posts: 39
Re: [Question] Session URL (ItemID) with other modules
« Reply #2 on: March 06, 2008, 03:06:29 am »
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

  • Beginner
  • *
  • Posts: 2
    • www.bgnetworks.com.mx
Re: [Question] Session URL (ItemID) with other modules
« Reply #3 on: July 01, 2008, 22:48:51 pm »
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

  • Jr. Member
  • **
  • Posts: 52
    • Wooza Shop - Online mall and shops
Re: [Question] Session URL (ItemID) with other modules
« Reply #4 on: July 05, 2008, 21:14:26 pm »
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

  • Beginner
  • *
  • Posts: 23
Re: [Question] Session URL (ItemID) with other modules
« Reply #5 on: August 04, 2008, 14:50:28 pm »
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

  • Jr. Member
  • **
  • Posts: 79
Re: [Question] Session URL (ItemID) with other modules
« Reply #6 on: October 09, 2008, 13:57:36 pm »
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!