Skip to content

Commit

Permalink
fix: Handle region updates on cart (1/n) (medusajs#9369)
Browse files Browse the repository at this point in the history
**What**

On cart creation:
- If region only has one country -> create cart with country code

On cart updates:
- If shipping address country code is provided in input ->
  - If cart region doesn't include that country -> throw
  - If cart includes the country -> update shipping address
- If region is provided in input and is different from the one currently on the cart -> 
  - If there is a shipping address on the cart -> clear the address
    - If the region only has one country -> set country code of address
  - If there is not a shipping address on the cart ->
    - If the region only has one country -> set country code of address


Closes CC-545
  • Loading branch information
olivermrbl authored and panalgin committed Oct 7, 2024
1 parent f8f36bb commit eba5267
Show file tree
Hide file tree
Showing 5 changed files with 540 additions and 77 deletions.
Loading

0 comments on commit eba5267

Please sign in to comment.