Checkout Javascript failed to execute

dstofkadstofka Member
in Help edited April 2012
Our store has run up against the maximum-weight restriction in UPS's live shipping calculator. So, following what has been documented in the forums by some other Foxycart users, we have customized our store's checkout page with some Javascript code that breaks up high-weight orders into smaller package sizes.

The workaround has been working fine until mid-day yesterday (4/9/2012), when a high-weight order came through without a sufficiently high shipping cost added. But unfortunately, we can't replicate the problem -- when we attempt our own checkout using the very same cart contents and ship-to information, the shipping cost we get is calculated correctly.


While I realize that our particular Javascript code is not supported, does anyone have any ideas as to how, in general, Javascript code on the checkout page might fail to execute, and do so only once in a blue moon? At first I thought a user with Javascript disabled might bypass our code, but it appears the FoxyCart checkout process itself requires Javascript. Are there cases where custom checkout templates fail to load for some reason (say, if there's a temporary server outage) and the default checkout template gets used instead?
Comments
  • lancelance Member, Community Support Member
    @dstofka -

    Did the order actually process, or did it generate a shipping error for being overweight? It might help the admins to look at the transaction if it did actually process, so if you can provide a transaction ID number that might help.

    Also, if you're able to whisper your store URL so I can just take a look and see if anything jumps out at me, that would be good, too.

    Generally, there shouldn't be a time when you custom checkout template is not loaded, and you are correct, is JS is disabled on a user's browser, they won't be able to checkout at all.

    Lance
  • The order actually went through.
  • lancelance Member, Community Support Member
    Thanks for the whisper.

    Here are a few notes. I see that on your checkout template you are still using the BEGIN FOXYCART FILES block. You should remove this from your cart and checkout templates. FoxyCart takes care of loading everything it needs (you can see this in the source in the "FC script insertion" block). You are also loading multiple instances of jquery - one that you call in the templae (1.3.2) and one that FoxyCart is loading (1.4.2). You'll want to remove your load of 1.3.2. While things seem to be working, loading these extra things could cause problems.

    In the case of the order that actually processed, is it possible that that user went through the PayPal Express checkout by clicking the PayPal button from the cart? That would certainly bypass any custom shipping you're doing on the checkout page. PayPal is notoriously awful when it comes to shipping options.

    Lance
  • Your PayPal Express Checkout theory is very interesting. Thanks very much for taking the time to help. Unfortunately since we can't replicate the error we won't know if these changes will actually help, but eliminating redundant code never hurts.
  • fc_adamfc_adam FoxyCart Team
    @dstofka,

    This does appear to be a javascript issue on your checkout, and shouldn't be too hard to fix. What I'd suggest is reordering your checkout template a little in regards to the <head> section, so that all css stylesheets are listed before any javascript blocks or includes. With the way that the FoxyCart checkout includes are added, they look for the last CSS stylesheet and add after that (or after the title tag if there are no stylsheets). As some of your jQuery reliant includes are before your CSS, jQuery is only be added after your javascript so it's throwing errors.

    Give that a try and see if it helps with this issue as well.
Sign In or Register to comment.