[Zen Cart] Broken Warning MOD Messages

Magic SEO URLs for Zen Cart.
cowspotbeads
Posts: 10
Joined: Tue Jun 10, 2008 6:01 pm

[Zen Cart] Broken Warning MOD Messages

Postby cowspotbeads » Fri Jun 20, 2008 11:28 am

Hello,

It seems that Magic SEO has broken a custom mod I had developed. The mod takes a look at the quantity a customer added for a product and when they hit add to cart if they have selected more than we have in stock it auto adjusts the quantity number to be the max we have in stock. It also displays a message stating:
"The item quantity you selected is not available. We have adjusted the shopping cart to reflect what we have in stock. <ITEM_NAME>, has been changed from: XXX to XXX"

It seems when Magic SEO is enabled the function of the shopping cart does the auto adjusting just fine, but the message does not display. I contacted the developer of this mod and he confirmed that it is Magic SEO by disabling the mod, testing (the message came up fine), then enabling the mod and the message does not appear.

This message (and the function) are extremely important as in my line of business we are not dealing with 1 or 2 products but they could order 50 different beads with a quantity of 200 each.

I currently have MAGIC SEO disabled becasue that message not being there has already caused several customers to complain to be that there must be a "virus" on my site changing their shopping cart so they did not want to put in their credit card info (lack of trust) and abandoned their cart.

I would leave MAGIC SEO disabled but it works awesome. My PR has sky rocketed since it was put in!

Jiri (or anybody), HELP!!!!!

Thanks,
Cowspot
http://www.cowspotbeads.com

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby inveo » Fri Jun 20, 2008 4:01 pm

This is caused by loosing Sessions and it is necessary to modify ZenCart sources in order to fix this issue.

Please open includes/classes/message_stack.php

Find:

Code: Select all

$_SESSION['messageToStack']= '';


Replace with:

Code: Select all

$_POST['SomeArrayItem'] = true;
$_SESSION['messageToStack']= '';

cowspotbeads
Posts: 10
Joined: Tue Jun 10, 2008 6:01 pm

Re: [Zen Cart] Broken Warning MOD Messages

Postby cowspotbeads » Sat Jun 21, 2008 12:04 pm

Hi Jiri,

Just wanted to let you know it worked like a charm!

BlessIsaacola
Follower
Posts: 98
Joined: Sun Feb 03, 2008 9:48 pm
Location: Kennesaw, GA
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby BlessIsaacola » Thu Jun 26, 2008 9:12 am

Well, I never thought MSU could be responsible for the problem we are experiencing until reading this post. When MSU is enabled and a customer search for a product that is not on site, this message is not displayed: There is no product that matches the search criteria. If MSU is off, then the message displays fine when searching for a keyword that is not available on our site.

J - any idea if the same solution you provided above will fix this or something else.

Thanks!
http://www.clevershoppers.com - Where Clever People Shop!

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby inveo » Thu Jun 26, 2008 9:49 am

BlessIsaacola wrote:J - any idea if the same solution you provided above will fix this or something else.


No, but if you use the code I have posted above, nothing will be break (even if you don't need it).
I think the problem you have is not directly caused by MSU, because I just tested it and it works fine. You can also test it at demo web: http://www.magic-seo-url.com/zencart/demo.html

Please post here lines from .htaccess file beginning with:

Code: Select all

RewriteRule ^search/results.html$

and

Code: Select all

RewriteRule ^search(/){0,1}$

BlessIsaacola
Follower
Posts: 98
Joined: Sun Feb 03, 2008 9:48 pm
Location: Kennesaw, GA
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby BlessIsaacola » Thu Jun 26, 2008 10:23 am

Thanks for the prompt response. Here are the codes from .htaccess:

Code: Select all

#advanced_search - advanced search
RewriteRule ^search(/){0,1}$ index.php?main_page=advanced_search [L,QSA]
#advanced_search_result - advanced search result
RewriteRule ^search/results.html$ index.php?main_page=advanced_search_result [L,QSA]
http://www.clevershoppers.com - Where Clever People Shop!

BlessIsaacola
Follower
Posts: 98
Joined: Sun Feb 03, 2008 9:48 pm
Location: Kennesaw, GA
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby BlessIsaacola » Thu Jun 26, 2008 10:26 am

J- because I always want to learn can you please educate me what this modified code you provided is doing that the zen cart default is not doing?

Code: Select all

$_POST['SomeArrayItem'] = true;
$_SESSION['messageToStack']= '';


Thanks!
http://www.clevershoppers.com - Where Clever People Shop!

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby inveo » Thu Jun 26, 2008 12:00 pm

Rewrite Rules look fine. I can only provide following debugging:

  1. post me FTP login details (the most fastest way :) )
  2. disable MSU, post created URL of successful and unsuccessful search results
  3. Try to test it with original Zen Cart files (especially includes/templates/template_default/templates/tpl_advanced_search_default.php and includes/templates/template_default/templates/tpl_advanced_search_result_default.php or includes/templates/cs_main/templates/tpl_advanced_search_default.php and includes/templates/cs_main/templates/tpl_advanced_search_result_default.php in case you have these files in cs_main template)
  4. Same with files in includes/modules/pages/advanced_search/ and includes/modules/pages/advanced_search_result/ directories

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Broken Warning MOD Messages

Postby inveo » Sun Nov 16, 2008 6:53 pm

BlessIsaacola wrote:J- because I always want to learn can you please educate me what this modified code you provided is doing that the zen cart default is not doing?

Code: Select all

$_POST['SomeArrayItem'] = true;
$_SESSION['messageToStack']= '';


Thanks!


It is only adding something into $_POST global array. If $_POST array is not empty, Magic SEO URL is not doing redirection to keywords-urls (so message stored in $_SESSION is not loosed).