Steps to reproduce
Add an address to an order via the API.
Expected behavior
Be able to use a temporary address in checkout similar to the frontend. It would be nice for there to be a boolean that could be sent with the shipping address to tell it to persist or not.
Actual behavior
The API always persists the address to a user's address book if there's a user and a bill_address_id and the state is transitioning out of the address step. So there's no way to add a temporary address under these conditions and it means that if the user goes back and edits the address info to add a new one, the new address won't be added to the address book unlike the first.
|
if !temporary_address && user && user.respond_to?(:persist_order_address) && bill_address_id |
|
before_transition from: :address, do: :persist_user_address! |
System configuration
Solidus 2.6
Steps to reproduce
Add an address to an order via the API.
Expected behavior
Be able to use a temporary address in checkout similar to the frontend. It would be nice for there to be a boolean that could be sent with the shipping address to tell it to persist or not.
Actual behavior
The API always persists the address to a user's address book if there's a user and a
bill_address_idand the state is transitioning out of the address step. So there's no way to add a temporary address under these conditions and it means that if the user goes back and edits the address info to add a new one, the new address won't be added to the address book unlike the first.solidus/core/app/models/spree/order.rb
Line 740 in dde082e
solidus/core/app/models/spree/order/checkout.rb
Line 96 in 475d9db
System configuration
Solidus 2.6