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.

Add contact_phone and address fields to store form and translations (#12875)

Gabriel Zortéa Lovisonbb525a32c7a5
diff --git a/admin/app/views/spree/admin/stores/form/_basic.html.erb b/admin/app/views/spree/admin/stores/form/_basic.html.erb
index d347c04016..e47fef7284 100644
--- a/admin/app/views/spree/admin/stores/form/_basic.html.erb
+++ b/admin/app/views/spree/admin/stores/form/_basic.html.erb
@@ -31,6 +31,23 @@
</div>
</div>
+ <div class="card mb-4">
+ <div class="card-header">
+ <h5 class="card-title"><%= Spree.t(:phone) %> & <%= Spree.t(:address) %></h5>
+ </div>
+ <div class="card-body">
+ <div class="form-group">
+ <%= f.label :contact_phone %>
+ <%= f.text_field :contact_phone, class: 'form-control' %>
+ </div>
+
+ <div class="form-group">
+ <%= f.label :address %>
+ <%= f.text_area :address, class: 'form-control', data: { controller: 'textarea-autogrow' } %>
+ </div>
+ </div>
+ </div>
+
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title"><%= Spree.t(:standards_and_formats) %></h5>
diff --git a/admin/app/views/spree/admin/translations/stores/_form.html.erb b/admin/app/views/spree/admin/translations/stores/_form.html.erb
index b8a598666a..15d36a13c6 100644
--- a/admin/app/views/spree/admin/translations/stores/_form.html.erb
+++ b/admin/app/views/spree/admin/translations/stores/_form.html.erb
@@ -14,6 +14,8 @@
<div class="trix-container mb-0">
<%= rich_text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), { contenteditable: !readonly } %>
</div>
+ <% when :address %>
+ <%= text_area_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly, data: { controller: 'textarea-autogrow'} %>
<% else %>
<%= text_field_tag "translation[#{field}][#{translation_locale}]", resource.get_field_with_locale(translation_locale, field), class: 'form-control', readonly: readonly %>
<% end %>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 0f79c07ecc..1662da7e66 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -151,6 +151,8 @@ en:
updated: Updated
user: User
spree/store:
+ address: Address
+ contact_phone: Contact Phone
mail_from_address: Mail From Address
meta_description: Meta Description
meta_keywords: Meta Keywords