Fix user's shipping & billing address interaction with order
There are several issues regarding this, see the individual commits.
This also makes legacy frontend work correctly:
- when order is created, the billing/shipping address will correctly be assigned to user if he doesn't have an address assigned
- when a new order is started, it will correctly use the user's billing/shipping address if present
This was quite broken with even a security issue with the unscoped Spree::Address query. I suggest to merge asap due to this.
This is tackling simliar problems to my PR here: https://github.com/spree/spree/pull/11606, maybe we want to merge this into one PR?
@stefnnn yes we could. Although your PR was not merged after 2 months. I am afraid the maintainers are sleeping? No point in putting in the work if it will never get merged.
@damianlegawiec ping, this is kinda important. Been using these fixes in production for a while now, no issues at all.
Updated to correctly determine use_billing? (fixes issue if ship is same as bill and gets updated in checkout form)
@damianlegawiec what do you think?
@damianlegawiec well??
