Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix address form (#12898)

brozek065cc2cf8cec
diff --git a/storefront/app/views/spree/checkout/_address.html.erb b/storefront/app/views/spree/checkout/_address.html.erb
index 1f416e7bd9..db70eb176f 100644
--- a/storefront/app/views/spree/checkout/_address.html.erb
+++ b/storefront/app/views/spree/checkout/_address.html.erb
@@ -134,7 +134,7 @@
address_name: address_name,
address_form: address_form,
address_type: address_type,
- address: Spree::Address.new(country: current_store.default_country, user: try_spree_current_user),
+ address: address_form.object.persisted? ? address_form.object : Spree::Address.new(country: current_store.default_country, user: try_spree_current_user),
form: form
} %>
</div>