Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21
    Join Date
    Jun 2011
    Posts
    10
    Plugin Contributions
    0

    Default Re: "Add to Cart" redirecting to page not found

    Same issue here.
    What I've found so far is:
    1. at line 19 of /includes/init_includes/init_sanitize.php there is a check if the $_SESSION['securityToken'] exists, if not, create one at line 21.
    - Test: Cleanup your browser cache, comment line 21 of init_sanitize.php and load a products page. Look at the HTML source code and you'll notice that the "securityToken" hidden field is blank.
    Do not browse for the product, go to directly to the product's page.

    2. when the page is loaded the init_sanitize.php creates a $_SESSION['securityToken'] because it doesn't exists
    3. when you try to add the product to your cart, you get a page not found, because at line 116 of /includes/functions/sessions.php there is another check for $_SESSION['securityToken'] - Seems that the first init_sanitize.php assignment of $_SESSION['securityToken'] is not working

    I'm using "Force Cookie Use" set to "True" - when changing to "False" everything works, but I get that ugly ?zenid=XXXXXXXXXXXXXXXXXX to my URL

    If you load the product's page twice, you don't face that issue. This only happens if someone that never visited your store comes right to your products page instead of browsing your categories for example.

  2. #22
    Join Date
    Jun 2011
    Posts
    10
    Plugin Contributions
    0

    Default Re: "Add to Cart" redirecting to page not found

    This is not a proper fix, but resolved for me until I find a better fix.
    At line 22 of the file init_sanitize.php I paste the following:
    Code:
    $link = HTTP_SERVER . $_SERVER['REQUEST_URI'];
    	if (ENABLE_SSL == 'true')
    		$link = HTTPS_SERVER . $_SERVER['REQUEST_URI'];
    
    	zen_redirect($link);
    This will redirect the user to the same page if a security token is not found.

  3. #23
    Join Date
    Jun 2011
    Posts
    10
    Plugin Contributions
    0

    Default Re: "Add to Cart" redirecting to page not found

    EDIT: the above fix will make your IPN notifications fail.
    So I don't recommend using it.

  4. #24
    Join Date
    Jan 2004
    Posts
    58,249
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: "Add to Cart" redirecting to page not found

    Quote Originally Posted by diego.s.v View Post
    I'm using "Force Cookie Use" set to "True" - when changing to "False" everything works, but I get that ugly ?zenid=XXXXXXXXXXXXXXXXXX to my URL
    Perhaps there's a deeper issue at stake here, such as your store isn't properly starting sessions, thus the addition of the zenid to the URL.
    THAT would be a smarter place to focus your attention.

    And especially since Zen Cart doesn't generate URLs that end in ?zenid=xxxx (namely the question-mark is the giveaway here). You're using some sort of alteration to the URL generation, probably a so-called "SEO" addon of some sort.
    Perhaps turning off all that other stuff and going back to the basic working Zen Cart code would be a good troubleshooting step. If there's still a problem there, when nothings being tampered with by custom code and .htaccess rules, then sorting out session problems in your configuration and/or your hosting would yield the most valuable and efficient results.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Replies: 0
    Last Post: 19 Jun 2011, 09:03 PM
  2. error - redirecting to HTTPS url 'page not found'
    By MULISH in forum General Questions
    Replies: 1
    Last Post: 4 Apr 2011, 12:21 PM
  3. ERROR - redirecting to HTTPS url (page not found))
    By MULISH in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 1 Apr 2011, 02:31 AM
  4. Replies: 2
    Last Post: 24 Jun 2010, 11:20 PM
  5. Shopping Cart Page Not Found / Cant view cart or checkout
    By pquery in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 30 Oct 2009, 06:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •