I am seeing an issue with commerce_shipping.js when using Chrome on OSX (lion).
I am not seeing this problems in FireFox (15.0.1 if it matters to anyone) on the same machine, I have not (yet) tested any other browsers.

The $(window).load() that calls $.fn.commerceCheckShippingRecalculation() is firing every time the continue button is clicked. This fires the AJAX callback to recalculate the shipping, and is stopping the page from advancing to the next step in the checkout process.

If I comment out the call then this behavior goes away (but the shipping is not recalculated on page load which I assume is the intention).
I am not sure what to propose as a more appropriate fix.

Comments

rszrama’s picture

Curious. I do all of my development on OS X / Chrome and haven't seen this yet. Any further clues? Clicking a submit button shouldn't trigger a window load event. : ?

jkopel’s picture

I spent quite a bit of time trying to figure this out, and am also stumped.
If I run the JS debugger in chrome I can catch a breakpoint in that window.load() handler, so it is clearly firing.
If I run XDebug I can catch a breakpoint in the ajax callback commerce_shipping_recalculate_services_refresh().
For that matter I can see the "throbber" that comes up to indicate activity on the shipping settings as soon as I click the continue button.

My checkout panes look like:
checkout settings

We have 2 flat rate services defined.
I have the shipping pane settings as:
shipping pane

If you can give me a hint as to where I might look I am happy to investigate further.
Thanks!

rszrama’s picture

I'll have to think about it. Could be I just never noticed it happening before, but then I'm not quite sure how checkout would've completed in my tests. I don't suppose you have any sort of iframe working on that page anywhere?

jkopel’s picture

Status: Active » Closed (fixed)

Well you don't have to think too hard...
We were not using iframes, but we were displaying the checkout form in a panel using the existing pages module, and it appears that there is some as yet undetermined path interaction that is causing all our problems.
The strange thing is that the JS hook is still being fired when you click continue, it just no longer matters when we don't use the existing pages path hijack.

rszrama’s picture

Hmm, ok. Lemme know if there's anything we should change for better compatibility in the future.