I'm using commerce_coupon, and my coupon form is on the same checkout pane as my shipping selector. Previously this seemed to work fine, but some update has caused an incompatibility.

Basically, if I enter a coupon code and hit the 'add coupon' button, the coupon is added to the order properly, but when I click the submit button to move on to the next pane, a validation error is thrown from the shipping module that says:

No valid shipping rates found for your order, and we require shipping service selection to complete checkout.

Even though I do have a shipping method selected. If I simply submit the form again, it goes through as expected. If I have more than one shipping method and I choose another method other than the default selected item, I can also progress to the next screen. So, basically, if I leave the shipping form as is, with the default option selected, and add a coupon, I cannot progress.

Unfortunately, I can't figure out if this is a validation issue with commerce_shipping, or an incorrect processing of the ajax functionality of commerce_coupon. If I do not add a coupon to the order, I can just hit the submit button and I can progress to the next screen and the shipping item is selected properly from the pre-selected default option.

Comments

rollingnet’s picture

I'm facing the same problem: it works everything well until I'm using coupon feature.
It is introduced in latest dev version of shipping or coupon module update.
I will investigate more on this issue.
This a blocking one for everyone that use coupon feature.

torgosPizza’s picture

The main reason this occurs is that whenever a checkout pane form is called, the Commerce routing system rebuilds all checkout pane forms by firing their callback functions.

That being said there is work being done for better Ajax handling in Commerce. Try the patch here: #1287124: Support recalculating shipping when the address is entered

And see more discussion at #1329308: Provide better core support for AJAX reloading of checkout panes / pages

rooby’s picture

Version: 7.x-2.0 » 7.x-2.2
Category: Support request » Bug report
Related issues: +#2026321: Avoid overwriting an already updated order
googletorp’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.