Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34
  1. #11
    Join Date
    Apr 2014
    Location
    NJ
    Posts
    59
    Plugin Contributions
    0

    Default Re: ajax error during checkout

    Quote Originally Posted by kobra View Post
    This explains why you did not have up to date configure's
    I have been looking at some of the online faqs on how to upgrade your zencart site, and I think they are saying that you should copy over the configure.php files from your older site.
    https://www.zen-cart.com/content.php...-zen-cart-site
    and
    https://www.zen-cart.com/entry.php?3...d-of-upgrading
    Quote Originally Posted by kobra View Post
    Code:
    define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');
    This should be a full path to the logs directory
    Code:
      //the following path is a COMPLETE path to the /logs/ folder  eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
      define('DIR_FS_LOGS', '/home/user/public_html/logs');
    I believe that the following IS a complete path to the /logs/ folder:
    Code:
    define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');
    DIR_FS_CATALOG is
    /home/mydir/MyTest/
    so that makes DIR_FS_LOGS
    /home/mydir/MyTest/logs

  2. #12
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,916
    Plugin Contributions
    13

    Default Re: ajax error during checkout

    wow, earthfriendly, there seems to be a lot of issues going on here....

    while i do run 1.5.4 on a local test server as well as on a client site, you said

    "Before I made sure to include the "www", in both the .htaccess file and the configure.php, I got additional ajax errors when I tried to use the admin..."

    perhaps someone else can chime in, but i do not think there are any ajax calls being made in the admin; i could be wrong.

    i'm guessing that adding the logs directory into your configure.php files is an excellent idea, but i doubt it's the root of your problem. my limited understanding of ajax is that you can send information to the server, get a response back, and process that response without the need to reload the page. which makes it very tricky to debug. from what i remember on how i implemented it, it was also part of a javascript file; in addition i was using an add-on as opposed to the base version.

    there is an ajax debugger add-on that you can use in chrome which will probably help isolate that part of the problem. what you want to look at is what you are sending to the server and what the server is sending you back. and you can take it from there.

    in addition, earlier you said:

    " Or should I just hope that it goes away when I switch to my real domain?"

    hope may spring eternal, but i have serious doubts that this will work when you switch to your real domain.... but again i could be wrong.

    good luck!
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #13
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: ajax error during checkout

    I believe that the following IS a complete path to the /logs/ folder:
    Code:
    define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');
    DIR_FS_CATALOG is
    /home/mydir/MyTest/
    so that makes DIR_FS_LOGS
    /home/mydir/MyTest/logs
    The item in red is correct not your previous assumption

    I am concentrating on this so that you can get mydebug files logged into your /logs folder in an attempt to proceed

  4. #14
    Join Date
    Apr 2014
    Location
    NJ
    Posts
    59
    Plugin Contributions
    0

    Default Re: ajax error during checkout

    Thanks to both kobra and carlwhat for your responses!
    kobra, I will modify the entry in my config files to include the complete path for the logs directory.
    However, as carlwhat suggested, that may not help with this particular problem, because according to what I've been reading, ajax errors don't show up in the logs.

    I added firebug to firefox, and started it up right before my click to go to the confirmation page, and I clicked on the console to see what info would show up after I clicked to confirm.
    I need to spend more time on learning how to debug in firebug, but as a first pass, I saw the following:

    Error:
    uncaught exception: out of memory
    This was in red, and might be significant. I'm not sure how to get more details on what generated this error. I think I would need to set breaks in the code, or something like that. Can't go further now, because I have to get to work. If anyone has experience in using this, and wants to help, please feel free to chime in on how I can get more info.

    Warnings:
    This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.

    POST https://www.test.mydomain.com/ajax.p...NoscriptCookie

    I didn't see an actual return value.

    I'll look into this more tonight, but if anyone has any suggestions, please let me know.
    Thanks very much!

  5. #15
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,716
    Plugin Contributions
    13

    Default Re: ajax error during checkout

    First of all, just for anyone lurking now or in the future, one should never try to automate any Zen Cart load or upgrade. It just never works out well. Not saying it was done here, BUT should be listed as a no-no wherever possible.
    Anywho.....
    In the place you quoted (https://www.zen-cart.com/content.php...-zen-cart-site), the item I put in red (see below) often gets missed and probably should be changed. It tells you to copy the old configs ONLY IF they are not present. Many glance over the if and ruin perfectly good config files by copying over the ones installed by Zen Cart. Since the 1.5.x series, the config files are way different from their predecessors. Trying to use earlier configs really screws things up. You should only need to touch the two configs AFTER moving them to their final resting place on your server. IOW, if you did your upgrade in /shoptest and moved back to the root, you'd remove any mention of /shoptest from both configs. Other than turning SSL on or off, that's really the only reason to touch the configs.
    3. Testing
    Make a NEW database to install the new version of Zen CartŪ into.
    If the last backup you made of your data is older than the last order that might have been processed or customer registration, make a fresh database backup.
    Restore your database from the backup in step #1 earlier into your NEW database just created.
    If your /zen_new folder doesn't have "/includes/configure.php" and "/admin/includes/configure.php" files, copy them from your old store folder.
    IMHO, The second link () also should mention that
    Replace all the Zen Cart php files/folders/images/everything in your live store with the new files (except the configure.php files which usually stay the same)
    Be sure to also delete any files that don't belong anymore.
    can be a problem if you are upgrading from 1.3.x to 1.5.x. As mentioned before, the config files are WAY different. Again, copying and editing the NEW could save lots of trouble when upgrading.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  6. #16
    Join Date
    Apr 2014
    Location
    NJ
    Posts
    59
    Plugin Contributions
    0

    Default Re: ajax error during checkout

    I think I basically followed all the upgrade steps correctly, except that I copied over the configure.php files before running the upgrade script. It looks like I should have just not copied them over, and then run the upgrade script, which would have created them from scratch, and then I could have modified them as necessary. Is that correct?

    Anyway, I did some more testing, and found a few things.
    I have 3 payment modules installed: cod, paypal express, and authorizenet_aim.
    I tested all 3 modules, and the cod and paypal express modules both give the ajax error, but the authorizenet_aim module does not give the error. I was able to checkout completely using the authorizenet_aim module, without any ajax errors.
    I looked at the code for the 3 modules, and it is not obvious to me what the difference is for each of them, such that 2 would generate this error, and one would not.
    Also, just to be clear, I did remove and reinstall each of the payment modules for the upgrade.

    I tried debugging in firefox firebug, and set it to break on all errors, but this didn't make any difference, and it didn't break any sooner.
    As I said above, the Post is:
    Code:
     https://www.test.mydomain.com/ajax.php?act=ajaxPayment&method=setNoscriptCookie
    and the error is
    uncaught exception: out of memory

    I don't see any other useful information.
    Is there some place where I can put some debug print statements that will show up in the firebug debug console, that might be helpful? Anything else I can do to try to figure this out?

    I'm at a loss as to how to proceed. Does anyone have any suggestions?

    Thanks very much for your help!

  7. #17
    Join Date
    Apr 2014
    Location
    NJ
    Posts
    59
    Plugin Contributions
    0

    Default Re: ajax error during checkout

    One more thing. I just tried to redo the upgrade process on my test site.
    I re-backed up the db from my live site.
    I restored the backed-up db to my test db.
    I removed both configure.php files from the test site.
    I went to www.test.mydomain.com/zc_install/index.php
    It created an empty includes/configure.php
    It asked me to create an empty admin/includes/configure.php
    Once I did that, it said: Ready to Install? (This will wipe any existing data. You are NOT in Upgrade mode!!!)
    So, my understanding is, if you do not copy over your previous configure.php files, it will not be able to connect to your db, and thus, it will not be able to do an upgrade, only a new install, which will wipe out your db. So I don't see how you can get it to recreate your configure.php files with any new variables, and still do an upgrade, without wiping out your db. Is there something I'm doing wrong in this process?

  8. #18
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,716
    Plugin Contributions
    13

    Default Re: ajax error during checkout

    You missed my point. You keep deleting correct config files.
    Use the Zen Cart install to create a new site. In so doing, IT will create the CORRECT config files. Empty the database it creates and replace it with your old. Copy any image files from old to new. You now have a working new site with correct config files. There won't be any mods or templates but, your site will work at the new location. You can then apply any mods or templates to complete the install/upgrade.
    You will NOT need to touch the config files again until you MOVE the new install/upgrade. If you did the install/upgrade in yoursite.com/test and wanted to move it back to yoursite.com, you would edit the two configs to remove any reference to /test.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  9. #19
    Join Date
    Apr 2014
    Location
    NJ
    Posts
    59
    Plugin Contributions
    0

    Default Re: ajax error during checkout

    There has been some really helpful information about the upgrade process. Thanks to everyone for their help with this.
    But back to my original issues, I wonder if anyone has any suggestions on how I can debug this ajax error issue?
    I am a programmer, and I am willing to work to resolve this, and to report my findings to the zencart community. But I don't have any experience with ajax, and I'm not sure how it is used in the checkout process of zencart. As I said above, I tried using firebug in firefox to get more information on the request and response.
    Like I said above, the Post is:
    Code:
    https://www.test.mydomain.com/ajax.php?act=ajaxPayment&method=setNoscriptCookie
    and the error is
    uncaught exception: out of memory.
    Is there some place in the code where I can put some debug print statements that will show up in the firebug debug console, or in the error logs, that might be helpful? Anything else I can do to try to figure this out?
    Also, as I said above, when I used the cod and paypal payment methods, I got the ajax error when I clicked to go to the order confirmation page. But when I used the authorizenet_aim payment method, I was able to checkout completely without any errors. I looked at the code for the 3 payment modules, and I didn't see anything obvious that would cause the errors in the 2 modules, but not in the third.

    I'm at a loss as to how to proceed. Does anyone have any suggestions?
    I'm considering hiring someone to solve this for me. But as I said, I am a programmer, and I'd like to learn how to do it myself. I'd really appreciate any help with this!

    Thanks very much for your help! I really appreciate it!

  10. #20
    Join Date
    Apr 2014
    Location
    NJ
    Posts
    59
    Plugin Contributions
    0

    Default Re: ajax error during checkout

    I've been trying to make progress on this. I've made a little progress.
    (1) I found the file containing the javascript code that generates the original error message that I saw:
    Code:
    An unknown response null::null::was received while processing an ajax call...
    in includes/templates/template_default/jscript/jscript_framework.php.
    I was able to see more information by adding options.url to the alert message.
    I now see that the ajax call that generated the error is:
    Code:
    ajax.php?act=ajaxPayment&method=doesCollectCardDataOnsite
    This actually makes a little sense, because both cod and paypal express generated the error, and they both do NOT collect the card data on the website, while authorizenet_aim does not generate the error, and it DOES collect the card data on the website, and its class has this variable set to TRUE. So I think the error may somehow be caused within the code that deals with doesCollectCardDataOnsite or collectsCardDataOnsite
    (2)
    When I looked at the page source of the checkout_payment page, I noticed that the end of the javascript function check_form, has 2 return statements in a row:
    Code:
    if (error == 1 && submitter != 1) {
        alert(error_message);
        return false;
      } else {
       return collectsCardDataOnsite(payment_value);
        return true;
      }
    This is because in the file includes/classes/payment.php, in the function javascript_validation, it contains
    Code:
           $js =  $js .'  if (error == 1 && submitter != 1) {' . "\n";
           $js =  $js .'    alert(error_message);' . "\n";
           $js =  $js . '    return false;' . "\n";
           $js =  $js .'  } else {' . "\n";
           if ($this->doesCollectsCardDataOnsite == true && PADSS_AJAX_CHECKOUT == '1') {
             $js .= '   return collectsCardDataOnsite(payment_value);' . "\n";
           }
           $js =  $js .'    return true;' . "\n";
    I'm guessing that the "if" statement should perhaps be
    Code:
           if ($this->doesCollectsCardDataOnsite == true && PADSS_AJAX_CHECKOUT == '1') {
             $js .= '   return collectsCardDataOnsite(payment_value);' . "\n";
           } else {
           $js =  $js .'    return true;' . "\n";
           }
    but I'm not sure about that. (I did try making this change, but I still get the error.)

    I did read somewhere that this ajax out of memory error could be caused by a form being submitted that causes a page to redirect, which expunges the ajax javascript. I'm not sure if that applies in this case.

    I've been putting in alerts into the javascript, and I've been printing debug statements into a file, to see if I can discover anything interesting, but I haven't made any more revelations.
    I'm hoping that perhaps something that I said above might trigger some ideas for the zencart developers, and you might have suggestions of things that I could try, to figure this out and hopefully fix it.
    I just don't understand what would be different in my site, so that no one else has come across this problem for the cod or paypal express modules. I haven't made any changes directly to those modules. And I don't think I've made any changes to the checkout process, or the payment class.
    Any ideas/suggestions would be greatly appreciated!! Thanks very much!

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. 404 error during checkout
    By mike-1981 in forum General Questions
    Replies: 2
    Last Post: 7 Jan 2012, 08:46 PM
  2. Replies: 3
    Last Post: 16 Feb 2010, 05:33 PM
  3. Error during checkout
    By dealbyethan.com in forum General Questions
    Replies: 1
    Last Post: 14 Apr 2007, 07:47 PM
  4. Error during checkout...
    By audradh in forum General Questions
    Replies: 3
    Last Post: 24 Aug 2006, 05:30 AM

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