solidusio / solidusio/solidus

Allow a temporary (non-persisted) address in the checkout API

Open
#2,845 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

changelog:solidus_api
Dominant language
Ruby
Stars
5.3k
Forks
1.4k
Avg merge
1d 22h
Merged PRs (30d)
62

Description

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.

https://github.com/solidusio/solidus/blob/dde082e96b56a96ea0b535637685f37f0a96e8bf/core/app/models/spree/order.rb#L740

https://github.com/solidusio/solidus/blob/475d9db5d0291dd4aeddc58ec919988c336729bb/core/app/models/spree/order/checkout.rb#L96

System configuration

Solidus 2.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked logic in core/app/models/spree/order.rb around line 740 and core/app/models/spree/order/checkout.rb around line 96. Trace how the checkout API persists addresses when leaving the address step, then determine how a request option could preserve temporary-address behavior while retaining the expected address-book behavior. Done means the API supports both persistence choices without changing the existing default.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.