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.

Require email also for delivery state in checkout

Damian Legawiec1f3b8e4fee26
diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rb
index 371b376de4..c22567de29 100644
--- a/core/app/models/spree/order.rb
+++ b/core/app/models/spree/order.rb
@@ -733,8 +733,9 @@ module Spree
end
# Determine if email is required (we don't want validation errors before we hit the checkout)
+ # we need to add delivery to the list for quick checkouts
def require_email
- true unless new_record? || ['cart', 'address'].include?(state)
+ true unless new_record? || ['cart', 'address', 'delivery'].include?(state)
end
def ensure_line_items_present