Skip to content

Commit d11fd47

Browse files
committed
Update store attributes to include more contact information
1 parent ca1ae4d commit d11fd47

File tree

3 files changed

+57
-2
lines changed

3 files changed

+57
-2
lines changed

backend/app/views/spree/admin/stores/_form.html.erb

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,32 @@
3030
<%= f.text_area :meta_description, class: 'fullwidth' %>
3131
<%= f.error_message_on :meta_description %>
3232
<% end %>
33+
34+
<%= f.field_container :legal_name do %>
35+
<%= f.label :legal_name %>
36+
<%= f.text_field :legal_name, class: 'fullwidth' %>
37+
<%= f.error_message_on :legal_name %>
38+
<% end %>
39+
40+
<%= f.field_container :tax_id do %>
41+
<%= f.label :tax_id %>
42+
<%= f.text_field :tax_id, class: 'fullwidth' %>
43+
<%= f.error_message_on :tax_id %>
44+
<% end %>
45+
46+
<%= f.field_container :address do %>
47+
<%= f.label :address %>
48+
<%= f.text_area :address, class: 'fullwidth' %>
49+
<%= f.error_message_on :address %>
50+
<% end %>
51+
52+
<%= f.field_container :contact_phone do %>
53+
<%= f.label :contact_phone %>
54+
<%= f.phone_field :contact_phone, class: 'fullwidth' %>
55+
<%= f.error_message_on :contact_phone %>
56+
<% end %>
3357
</div>
58+
3459
<div class="col-12 col-md-6">
3560
<%= f.field_container :url do %>
3661
<%= f.label :url, class: 'required' %>
@@ -46,7 +71,7 @@
4671

4772
<%= f.field_container :bcc_email do %>
4873
<%= f.label :bcc_email %>
49-
<%= f.text_field :bcc_email, class: 'fullwidth' %>
74+
<%= f.email_field :bcc_email, class: 'fullwidth' %>
5075
<%= f.error_message_on :bcc_email %>
5176
<% end %>
5277

@@ -81,5 +106,23 @@
81106
{ class: 'select2 fullwidth', multiple: true } %>
82107
<%= f.error_message_on :default_currency %>
83108
<% end %>
109+
110+
<%= f.field_container :contact_email do %>
111+
<%= f.label :contact_email %>
112+
<%= f.email_field :contact_email, class: 'fullwidth' %>
113+
<%= f.error_message_on :contact_email %>
114+
<% end %>
115+
116+
<%= f.field_container :vat_id do %>
117+
<%= f.label :vat_id %>
118+
<%= f.text_field :vat_id, class: 'fullwidth' %>
119+
<%= f.error_message_on :vat_id %>
120+
<% end %>
121+
122+
<%= f.field_container :description do %>
123+
<%= f.label :description %>
124+
<%= f.text_area :description, class: 'fullwidth' %>
125+
<%= f.error_message_on :description %>
126+
<% end %>
84127
</div>
85128
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class AddStoreAttributesToSpreeStores < ActiveRecord::Migration[7.2]
2+
def change
3+
add_column :spree_stores, :legal_name, :string
4+
add_column :spree_stores, :tax_id, :string
5+
add_column :spree_stores, :address, :text
6+
add_column :spree_stores, :contact_phone, :string
7+
add_column :spree_stores, :contact_email, :string
8+
add_column :spree_stores, :vat_id, :string
9+
add_column :spree_stores, :description, :text
10+
end
11+
end

core/lib/spree/permitted_attributes.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ module PermittedAttributes
113113
@@store_attributes = [:name, :url, :seo_title, :meta_keywords,
114114
:meta_description, :default_currency,
115115
:mail_from_address, :cart_tax_country_iso,
116-
:bcc_email]
116+
:bcc_email, :code, :legal_name, :tax_id, :address,
117+
:contact_phone, :contact_email, :vat_id, :description]
117118

118119
@@taxonomy_attributes = [:name]
119120

0 commit comments

Comments
 (0)