Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default [Duplicate] Redirected to prod not found on add-to-cart of product_free_shipping_info

    Using version 1.5.1, was upgraded from version 1.5.0; however, have also performed compares multiple times against brand new code to confirm no unintentional/unexpected differences.


    Current settings considered as applicable to the actions:
    Under My Store: Show cart after add product is false:

    Current situation is this, when I select a product to view that is a member of the product type free shipping, then I add that item to the cart through clicking the buy now button, the item is added to the cart (verified by cart contents and the green message provided at the top of the screen), as part of the screen refresh though, the url loses it's &products_id=XX statement (where XX is the product id number), and the customer is show a sorry the product is not found type error message.

    I haven't gone through and reviewed the individual module files yet, but when comparing the template files of tpl_product_free_shipping_info with tpl_product_info, they are relatively the same with just a few variable differences which made sense (though I didn't go through line-by-line to identify cases where things should be different), I did the same for the pages area, again some minor differences, the header_php.php file for product_info contains more query related actions than the product_free_shipping_info one, but nothing that seemed like it would modify the redirect/parameters associated.

    So, initially had host/index.php?main_page=product_free_shipping_info&cPath=1&products_id=20

    After clicking on add to cart from the product's info page, URI became:
    host/index.php?main_page=product_free_shipping_info&number_of_uploads=0&cPath=1

    And the screen showed the sorry product could not be found message.

    I've tried my classic template, knowing that in the templates area of my normal template, the products_free_shipping has not been overriden, and I don't recall seeing any module overrides for the same, so I am expecting that whatever other issue may be in other modifications or in base code. :/

    I haven't seen this reported in the forums via search, but thought someone may have reported it long ago. (Seem to recall something about it, but because at that time I had show cart after add set to true, it wasn't an issue for me and I didn't think I would ever change to a false setting.

    Any input, any further information requested? Can provide a web address; however, URI rewriting is used on the active site, it is NOT the reason this is happening, but would make it difficult to see a true before and after web address, more the before part. I was able to track down the uri's fully on an independent test site.

    I also tried adding a new product of the product_free_shipping type and problem was reproduced with a different products_id.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,871
    Plugin Contributions
    96

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    I can confirm this behavior on a "stock" Zen Cart v1.5.1 install with the demo products (http://localhost/v1.5.1/index.php?ma...roducts_id=172).

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    Quote Originally Posted by lat9 View Post
    I can confirm this behavior on a "stock" Zen Cart v1.5.1 install with the demo products (http://localhost/v1.5.1/index.php?ma...roducts_id=172).
    Indication found that corrected in 1.5.2 or 1.6.0? (Ie, possible to borrow some code?)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    The fix should be to edit the file:
    /includes/init_includes/init_cart_handler.php

    and add the code in RED:
    Code:
      } else {
        $chk_handler = zen_get_info_page(isset($_GET['products_id']) ? $_GET['products_id'] : 0);
        $goto = $_GET['main_page'];
        if ($_GET['action'] == 'buy_now') {
    Code:
            $parameters = array('action', 'products_id');
          }
        } elseif ($_GET['main_page'] == $chk_handler) {
          $parameters = array('action', 'pid', 'main_page');
        } else {
          $parameters = array('action', 'pid', 'main_page', 'products_id');
        }
    This has been fixed in v1.5.2 and v1.6 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    Quote Originally Posted by Ajeh View Post
    The fix should be to edit the file:
    /includes/init_includes/init_cart_handler.php

    and add the code in RED:
    Code:
      } else {
        $chk_handler = zen_get_info_page(isset($_GET['products_id']) ? $_GET['products_id'] : 0);
        $goto = $_GET['main_page'];
        if ($_GET['action'] == 'buy_now') {
    Code:
            $parameters = array('action', 'products_id');
          }
        } elseif ($_GET['main_page'] == $chk_handler) {
          $parameters = array('action', 'pid', 'main_page');
        } else {
          $parameters = array('action', 'pid', 'main_page', 'products_id');
        }
    This has been fixed in v1.5.2 and v1.6 ...
    Thank you. Interesting thing is that I had gone to that area of the file, and tried a different fix of my own, but guess I was in the right area, just wrong code. Ie. My attempt did not work. I will try this as soon as I get to a computer and report back (for those that might take an interest). I doubt there will be any further corrections needed to address this issue. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,871
    Plugin Contributions
    96

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    Looks good, Ajeh. That corrects the issue for all products that are not of type product_info!

    Nice catch, mc12345678!

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    Thanks for the update that this is working for you lat9 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    Quote Originally Posted by lat9 View Post
    Looks good, Ajeh. That corrects the issue for all products that are not of type product_info!

    Nice catch, mc12345678!
    Thanx lat9, I can't take all the credit though. :) someone else found it before me. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Redirected to product not found from add-to-cart of product_free_shipping_info

    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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.

 

 

Similar Threads

  1. Add to cart showing 'page not found'
    By metaus in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Oct 2012, 10:57 PM
  2. v150 Getting redirected to Page not Found when adding to shopping cart
    By jmichaelstanley in forum Upgrading to 1.5.x
    Replies: 10
    Last Post: 18 Aug 2012, 02:29 PM
  3. Replies: 2
    Last Post: 24 Jun 2010, 11:20 PM
  4. Add To Cart - Page Not Found
    By Natallia in forum General Questions
    Replies: 1
    Last Post: 8 Jun 2008, 02:03 AM
  5. Add to cart getting redirected to My Account ???
    By Mwafrika in forum General Questions
    Replies: 0
    Last Post: 4 Jun 2008, 03:20 PM

Posting Permissions

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