Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: What code is triggered by "Add to cart"?

    Who is your webhost?

  2. #2
    Join Date
    Jul 2014
    Location
    Denmark
    Posts
    27
    Plugin Contributions
    0

    Default Re: What code is triggered by "Add to cart"?

    Justhost. I've also read about users having session problems due to Suhosin, but a phpinfo on the host server reveals Suhosin isn't installled.

  3. #3
    Join Date
    Jul 2014
    Location
    Denmark
    Posts
    27
    Plugin Contributions
    0

    Default Re: What code is triggered by "Add to cart"?

    So in order to troubleshoot I'm still stuck with the original question... what code is executed immediately upon clicking "add to cart", before application_top.php?

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

    Default Re: What code is triggered by "Add to cart"?

    The action to be performed/location to go based on clicking a button in a form is identified at the start of the form. Once the code has been parsed to display on the screen, the full path can be realized. Generally speaking, either the next action is to load a specific file or to have index.php process the request. I'm not sure what the "test" was to determine that application_top had not been loaded as part of the redirect or not but it is unusual for the zenID/Token to change when the routine conditions for a time-out have not occurred.

    Besides adding custom pages which are assumed to play a factor in why there may be a session issue, where did you obtain the files installed to run ZC? How was it installed? I know there is something about the php.ini file that I should ask, but can't think of it at the moment. Settings associated to it can be found in the admin panel version section.

    As for the notifier trace that was performed earlier, may want to look at what was notified prior to the cart portion as somewhere previously may be the "controller" that directed to load the timeout after parsing the cart code. Might look for a start that does not have an end or if it does that the end is after the timeout being loaded/parsed...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: What code is triggered by "Add to cart"?

    Quote Originally Posted by flyvholm View Post
    So in order to troubleshoot I'm still stuck with the original question... what code is executed immediately upon clicking "add to cart", before application_top.php?
    Quick answer: nothing.

    application_top.php is the first module loaded by /index.php. The module that does get control on an add-to-cart action is /includes/main_cart_handler.php, loaded late in the start-up process; depending on the cart-related request, it will call one of the shopping_cart class functions.

  6. #6
    Join Date
    Jul 2014
    Location
    Denmark
    Posts
    27
    Plugin Contributions
    0

    Default Re: What code is triggered by "Add to cart"?

    I made two huge mistakes. application_top does indeed execute immediately after clicking "add to cart", then it runs a second time after the redirect. I only saw the output from the second instance because I was writing it to a file without appending.
    So I tracked the problem as far as: application_top.php -> autoload_func.php -> init_sessions.php -> zen_session_start() -> session_start()
    This function assigns the variable $_SESSION['securityToken'] which must match $_POST['securityToken'] to avoid being redirected to the timeout page later. In Chrome and Opera (but not Firefox or Safari) a non-matching security token was assigned, hence the trouble.
    I did not troubleshoot further because at this point I realized another mistake. I had not tested a very simple fix that had worked for others: Changing the HTTP_SERVER in the configure.php files to the secure address used for the HTTPS_SERVER. I mistakenly thought that issue was only on servers with Suhosin enabled, but apparently not. Session timout errors be gone...

 

 

Similar Threads

  1. v154 Which file contains the code for "Add to cart"?
    By joecooper in forum General Questions
    Replies: 11
    Last Post: 7 Oct 2015, 05:07 PM
  2. v139h Cannot "add to cart", "sign up", or "log in". Returns to home.
    By Damn Kitten in forum General Questions
    Replies: 3
    Last Post: 12 Aug 2013, 03:11 AM
  3. Replies: 2
    Last Post: 11 Feb 2010, 09:13 PM
  4. help:zen cart code - what do "zen_" functions mean/do?
    By dreamwheel in forum General Questions
    Replies: 2
    Last Post: 16 Jun 2009, 07:19 PM
  5. Modify "add to cart" "write a review" "tell a friend"
    By Marlake in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 10 May 2008, 12:05 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