Zen Cart Logo
Forums / Upgrading to 1.5.x / Getting redirected to Page not Found when adding to shopping cart

Getting redirected to Page not Found when adding to shopping cart

Views: 8,382

Results 1 to 11 of 11
29 May 2012, 11:14 PM
#1
jmichaelstanley avatar

jmichaelstanley

New Zenner

Join Date:
May 2012
Posts:
4
Plugin Contributions:
0

Getting redirected to Page not Found when adding to shopping cart

Hello Zen Cart Community! I am in the process of upgrading from v1.3.9h to 1.5 and everything seems to be going well except for one major problem. When I try adding a product to my shopping cart I am directed to Page Not Found. More details below.

Current Live Site on 1.3.9: http://wwww.mariettesbacktobasics.com/index.php?main_page=product_info&products_id=256

Staging of New 1.5 Site: http://dev.mariettesbacktobasics.com/index.php?main_page=product_info&products_id=256

To build out the staging environment I setup a sub-domain and new database into which I duplicated the tables from the current installation. I then FTP'd the new version and ran the install scripts and update database scripts. Everything went fine with no errors. I then uploaded my custom template. And added my custom page definitions to modules and languages. (I did not touch the majority of the language and module files, only my custom ones and I compared with the clean files as directed by the instructions).

It occurs to me that the issue might be related to sessions so my session config is as follows:
Attachment 10531

However, it looks like a zenid cookie is being set. (I have tried setting recreate session to FALSE).

Both setups are running PHP version 5.2.17.

I have compared tpl_product_info_display.php with the clean 1.5 template both the cart_quantity form and the button look the same. I've also compared the shopping cart files.

I have installed the USPS module (from Zencart) and MagneticOne Export Tools - RSS Feed Export.

If some one would at least point me in the right direction I would much appreciate it. If there is any important information I've left out of this post please let me know.

30 May 2012, 12:18 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting redirected to Page not Found when adding to shopping cart

Have you changed the setting for "Admin->Configuration->My Store->Display Cart After Adding Product?" away from the default of True for any reason?

30 May 2012, 1:26 AM
#3
jmichaelstanley avatar

jmichaelstanley

New Zenner

Join Date:
May 2012
Posts:
4
Plugin Contributions:
0

Re: Getting redirected to Page not Found when adding to shopping cart

I've tried with the setting both true and false. It seems to have no effect, I always end up with Page Not Found.

30 May 2012, 1:54 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting redirected to Page not Found when adding to shopping cart

Set Admin->Configuration->My Store->Missing Page Check to off, and try again. What error message do you get?

30 May 2012, 3:31 AM
#5
jmichaelstanley avatar

jmichaelstanley

New Zenner

Join Date:
May 2012
Posts:
4
Plugin Contributions:
0

Re: Getting redirected to Page not Found when adding to shopping cart

It appears missing page check was already turned off.

I've looked for log files but found no new "myDEBUG-admin" log files relating to this issue.

30 May 2012, 11:52 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting redirected to Page not Found when adding to shopping cart

Have you set up anything in your site's main /.htaccess file to send anything to page-not-found? ie: added an ErrorDocument directive to point to your index.php?main_page=page_not_found

There are only 2 ways that Zen Cart would send you to main_page=page_not_found:

  • the admin Missing Page Check setting set to Page Not Found - and then anytime you go to main_page=something_that_doesnt_exist it would redirect you
  • /.htaccess rule added to tell your entire site to use the ZC page-not-found when a 404 error is encountered

So, if your admin Missing Page Check is already set to off, then you must be hitting the .htaccess issue for some odd reason.

Keep in mind that Zen Cart does NOT supply a .htaccess for the root of your store. All its supplied .htaccess files are for subfolders, and are unrelated to the issue we're discussing here. So don't go looking at those files thinking they're relevant to this at all.

30 May 2012, 1:13 PM
#7
jmichaelstanley avatar

jmichaelstanley

New Zenner

Join Date:
May 2012
Posts:
4
Plugin Contributions:
0

Re: Getting redirected to Page not Found when adding to shopping cart

There is no .htaccess in my store root (/html/). I have setup a .htaccess for the domain (inside domains/dev.mariettesbacktobasics.com/) but I have not added an ErrorDocument directive. Are you sure it might not be in another .htaccess (there is one in /pub/)?

Which file does the redirecting? Perhaps I can look there for clues.

30 May 2012, 6:54 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting redirected to Page not Found when adding to shopping cart

The add-to-cart process does a redirect to the shopping-cart page.

There's no good reason for it to not do that correctly unless something in your site, OTHER THAN default original Zen Cart code, is interrupting that flow.

You'll need to figure out what's interfering with normal operation. I can't trigger your symptoms on any of my stores.
http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

19 Jun 2012, 12:44 PM
#9
lampivimpa avatar

lampivimpa

New Zenner

Join Date:
Mar 2008
Location:
Finland
Posts:
15
Plugin Contributions:
0

Re: Getting redirected to Page not Found when adding to shopping cart

I have exactly same problem after updating 1.38 -> 1.5. No access to shopping cart anymore. http://mammakko.eu/verkkokauppa/

19 Jun 2012, 4:11 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Getting redirected to Page not Found when adding to shopping cart

Probably something wrong with your URL-rewrite addons and modifications.

18 Aug 2012, 1:29 PM
#11
diego_s_v avatar

diego_s_v

New Zenner

Join Date:
Jun 2011
Location:
Cariacica, Brazil
Posts:
12
Plugin Contributions:
0

Re: Getting redirected to Page not Found when adding to shopping cart

I'm having this issue and I already know the crupt, but still couldn't find a solution.

Open the file includes/functions/functions_general.php
Inside the function zen_redirect - line 37 paste the following:

echo '<pre>';
print_r($url);
print_r(debug_backtrace());
print_r($_SERVER);
print_r($_SESSION);
die();

Then go to your the product's page
e.g
http://www.yourstore.com/index.php?main_page=product_info&cPath=13_236&products_id=8671

Clear your browser cache, reload the product's page (don't go to other pages) and try adding the product to your cart.
See if you get a redirect from line 33 of the file init_sanitize.php