-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary shipping rates callback
The callback `Spree::Order#ensure_available_shipping_rates` was explicitly written to be run before delivery. Running it before the `complete` step leaves the order in the `confirm` state, but without any shipments, and results in an error message does not make sense in that context ("We were unable to calculate shipping rates"). In fact, we have not even tried. It's almost impossible to setup an order such that this callback would actually trigger in a standard Solidus installation. The commit that introduced the callback, 7ba53b2, intends to move line item availability validations to the before complete callback, instead of "all the time". That makes sense, but this callback has somehow sneaked in there without any explanation of why its necessary. I delete a model spec that was introduced in e7450ec, testing the behaviour in question. The spec set the order up in a way that a normal checkout never would. If you get through delivery and payment to the confirm step, and then do literally anything to the order, it will be reset to either cart or address state. I edit another spec to test what the callback should actually do: Alert the user that for their recently entered shipping address, no shipping rates can be calculated.
- Loading branch information
Showing
3 changed files
with
5 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters