spree_core 4.1.8 → 4.2.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/spree/base_controller.rb +1 -0
- data/app/finders/spree/addresses/find.rb +17 -0
- data/app/helpers/spree/base_helper.rb +60 -13
- data/app/helpers/spree/mail_helper.rb +29 -0
- data/app/helpers/spree/products_helper.rb +2 -1
- data/app/mailers/spree/base_mailer.rb +17 -3
- data/app/mailers/spree/order_mailer.rb +11 -2
- data/app/mailers/spree/reimbursement_mailer.rb +4 -2
- data/app/mailers/spree/shipment_mailer.rb +4 -2
- data/app/models/concerns/spree/default_price.rb +2 -1
- data/app/models/concerns/spree/user_methods.rb +11 -5
- data/app/models/concerns/spree/user_payment_source.rb +1 -1
- data/app/models/spree/address.rb +13 -1
- data/app/models/spree/app_configuration.rb +5 -0
- data/app/models/spree/app_dependencies.rb +7 -1
- data/app/models/spree/credit_card.rb +5 -0
- data/app/models/spree/line_item.rb +12 -2
- data/app/models/spree/option_type.rb +5 -1
- data/app/models/spree/order.rb +33 -7
- data/app/models/spree/order/payments.rb +10 -2
- data/app/models/spree/preferences/store.rb +1 -1
- data/app/models/spree/price.rb +26 -2
- data/app/models/spree/product.rb +17 -7
- data/app/models/spree/promotion.rb +6 -0
- data/app/models/spree/promotion_handler/coupon.rb +1 -1
- data/app/models/spree/promotion_handler/promotion_duplicator.rb +9 -3
- data/app/models/spree/reimbursement.rb +2 -0
- data/app/models/spree/shipment.rb +2 -5
- data/app/models/spree/stock_location.rb +13 -2
- data/app/models/spree/store.rb +22 -2
- data/app/models/spree/variant.rb +20 -3
- data/app/presenters/spree/variant_presenter.rb +9 -1
- data/app/presenters/spree/variants/option_types_presenter.rb +1 -0
- data/app/services/spree/account/addresses/base.rb +39 -0
- data/app/services/spree/account/addresses/create.rb +18 -0
- data/app/services/spree/account/addresses/update.rb +18 -0
- data/app/services/spree/checkout/update.rb +13 -2
- data/app/views/layouts/spree/base_mailer.html.erb +45 -40
- data/app/views/spree/order_mailer/cancel_email.html.erb +19 -25
- data/app/views/spree/order_mailer/cancel_email.text.erb +24 -2
- data/app/views/spree/order_mailer/confirm_email.html.erb +18 -65
- data/app/views/spree/order_mailer/confirm_email.text.erb +2 -1
- data/app/views/spree/order_mailer/store_owner_notification_email.html.erb +23 -0
- data/app/views/spree/order_mailer/store_owner_notification_email.text.erb +38 -0
- data/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb +53 -58
- data/app/views/spree/reimbursement_mailer/reimbursement_email.text.erb +3 -1
- data/app/views/spree/shared/_base_mailer_footer.html.erb +6 -14
- data/app/views/spree/shared/_base_mailer_header.html.erb +12 -32
- data/app/views/spree/shared/_base_mailer_stylesheets.html.erb +293 -625
- data/app/views/spree/shared/_purchased_items_table.html.erb +60 -0
- data/app/views/spree/shared/purchased_items_table/_adjustment.html.erb +13 -0
- data/app/views/spree/shared/purchased_items_table/_line_item.html.erb +27 -0
- data/app/views/spree/shared/purchased_items_table/_subtotal.html.erb +13 -0
- data/app/views/spree/shared/purchased_items_table/_total.html.erb +13 -0
- data/app/views/spree/shipment_mailer/shipped_email.html.erb +31 -36
- data/app/views/spree/shipment_mailer/shipped_email.text.erb +2 -1
- data/config/initializers/assets.rb +1 -0
- data/config/locales/en.yml +123 -16
- data/db/default/spree/countries.rb +10 -4
- data/db/default/spree/states.rb +42 -5
- data/db/default/spree/stores.rb +17 -12
- data/db/default/spree/zones.rb +1 -1
- data/db/migrate/20140309033438_create_store_from_preferences.rb +1 -1
- data/db/migrate/20191017121054_add_supported_currencies_to_store.rb +10 -0
- data/db/migrate/20200102141311_add_social_to_spree_stores.rb +3 -0
- data/db/migrate/20200308210757_add_default_locale_to_spree_store.rb +7 -0
- data/db/migrate/20200310145140_add_customer_support_email_to_spree_store.rb +7 -0
- data/db/migrate/20200421095017_add_compare_at_amount_to_spree_prices.rb +7 -0
- data/db/migrate/20200423123001_add_default_country_id_to_spree_store.rb +9 -0
- data/db/migrate/20200430072209_add_footer_fields_to_spree_stores.rb +8 -0
- data/db/migrate/20200513154939_add_show_property_to_spree_product_properties.rb +5 -0
- data/db/migrate/20200607161221_add_store_owner_order_notification_delivered_to_spree_orders.rb +7 -0
- data/db/migrate/20200607161222_add_new_order_notifications_email_to_spree_stores.rb +7 -0
- data/db/migrate/20200610113542_add_label_to_spree_addresses.rb +5 -0
- data/db/migrate/20200826075557_add_unique_index_on_taxon_id_and_product_id_to_spree_products_taxons.rb +5 -0
- data/db/migrate/20201013084504_add_seo_robots_to_spree_stores.rb +5 -0
- data/lib/generators/spree/install/templates/vendor/assets/javascripts/spree/backend/all.js +0 -2
- data/lib/generators/spree/install/templates/vendor/assets/javascripts/spree/frontend/all.js +0 -2
- data/lib/generators/spree/mailers_preview/mailers_preview_generator.rb +23 -0
- data/lib/generators/spree/mailers_preview/templates/mailers/previews/order_preview.rb +13 -0
- data/lib/generators/spree/mailers_preview/templates/mailers/previews/reimbursement_preview.rb +5 -0
- data/lib/generators/spree/mailers_preview/templates/mailers/previews/shipment_preview.rb +5 -0
- data/lib/generators/spree/mailers_preview/templates/mailers/previews/user_preview.rb +11 -0
- data/lib/spree/core.rb +2 -0
- data/lib/spree/core/controller_helpers/common.rb +1 -0
- data/lib/spree/core/controller_helpers/currency_helpers.rb +15 -0
- data/lib/spree/core/controller_helpers/order.rb +9 -4
- data/lib/spree/core/controller_helpers/store.rb +12 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/permitted_attributes.rb +8 -5
- data/lib/spree/testing_support/authorization_helpers.rb +7 -4
- data/lib/spree/testing_support/factories/store_factory.rb +11 -8
- data/spree_core.gemspec +5 -4
- data/vendor/assets/javascripts/cleave.js +1669 -0
- metadata +55 -12
- data/app/views/spree/order_mailer/_adjustment.html.erb +0 -8
- data/app/views/spree/order_mailer/_subtotal.html.erb +0 -8
- data/app/views/spree/order_mailer/_total.html.erb +0 -8
@@ -1,18 +1,24 @@
|
|
1
1
|
require 'carmen'
|
2
2
|
|
3
|
+
EXCLUDED_COUNTRIES = ['AQ', 'AX', 'GS', 'UM', 'HM', 'IO', 'EH', 'BV', 'TF'].freeze
|
4
|
+
|
3
5
|
Carmen::Country.all.each do |country|
|
6
|
+
# Skip the creation of some territories, uninhabited islands and the Antarctic.
|
7
|
+
next if EXCLUDED_COUNTRIES.include?(country.alpha_2_code)
|
8
|
+
|
4
9
|
Spree::Country.where(
|
5
10
|
name: country.name,
|
6
11
|
iso3: country.alpha_3_code,
|
7
12
|
iso: country.alpha_2_code,
|
8
13
|
iso_name: country.name.upcase,
|
9
|
-
numcode: country.numeric_code
|
10
|
-
states_required: country.subregions?
|
14
|
+
numcode: country.numeric_code
|
11
15
|
).first_or_create
|
12
16
|
end
|
13
17
|
|
14
18
|
Spree::Config[:default_country_id] = Spree::Country.find_by(iso: 'US').id
|
15
19
|
|
16
|
-
#
|
17
|
-
|
20
|
+
# Find countries that do not use postal codes (by iso) and set 'zipcode_required' to false for them.
|
18
21
|
Spree::Country.where(iso: Spree::Address::NO_ZIPCODE_ISO_CODES).update_all(zipcode_required: false)
|
22
|
+
|
23
|
+
# Find all countries that require a state (province) at checkout and set 'states_required' to true.
|
24
|
+
Spree::Country.where(iso: Spree::Address::STATES_REQUIRED).update_all(states_required: true)
|
data/db/default/spree/states.rb
CHANGED
@@ -1,12 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
EXCLUDED_US_STATES = ['UM', 'AS', 'MP', 'VI', 'PR', 'GU'].freeze
|
4
|
+
EXCLUDED_CN_STATES = ['HK', 'MO', 'TW'].freeze
|
5
|
+
|
6
|
+
def state_level(country, subregion)
|
7
|
+
country.states.where(
|
8
|
+
name: subregion.name,
|
9
|
+
abbr: subregion.code
|
10
|
+
).first_or_create
|
11
|
+
end
|
12
|
+
|
13
|
+
def province_level(country, subregion)
|
14
|
+
subregion.subregions.each do |province|
|
15
|
+
country.states.where(
|
16
|
+
name: province.name,
|
17
|
+
abbr: province.code
|
18
|
+
).first_or_create
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
1
22
|
Spree::Country.where(states_required: true).each do |country|
|
2
23
|
carmen_country = Carmen::Country.named(country.name)
|
3
24
|
next unless carmen_country
|
4
25
|
|
5
26
|
carmen_country.subregions.each do |subregion|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
27
|
+
if carmen_country.alpha_2_code == 'US'
|
28
|
+
# Produces 50 states, one postal district (Washington DC)
|
29
|
+
# and 3 APO's as you would expect to see on any good U.S. states list.
|
30
|
+
next if EXCLUDED_US_STATES.include?(subregion.code)
|
31
|
+
|
32
|
+
state_level(country, subregion)
|
33
|
+
elsif carmen_country.alpha_2_code == 'CA' || carmen_country.alpha_2_code == 'MX'
|
34
|
+
# Force Canada and Mexico to use state-level data import from Carmen Gem
|
35
|
+
# else we pull in a subset of provinces that are not common at checkout.
|
36
|
+
state_level(country, subregion)
|
37
|
+
elsif carmen_country.alpha_2_code == 'CN'
|
38
|
+
# Removes 3 "States" from that list that are also listed as Countries,
|
39
|
+
# Hong Kong, Taiwan and Macao
|
40
|
+
next if EXCLUDED_CN_STATES.include?(subregion.code)
|
41
|
+
|
42
|
+
state_level(country, subregion)
|
43
|
+
elsif subregion.subregions?
|
44
|
+
province_level(country, subregion)
|
45
|
+
else
|
46
|
+
state_level(country, subregion)
|
47
|
+
end
|
11
48
|
end
|
12
49
|
end
|
data/db/default/spree/stores.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
default_store = Spree::Store.default
|
2
|
+
|
3
|
+
if default_store.persisted?
|
4
|
+
default_store.update!(default_country_id: Spree::Config[:default_country_id])
|
5
|
+
else
|
3
6
|
Spree::Store.new do |s|
|
4
|
-
s.name
|
5
|
-
s.code
|
6
|
-
s.url
|
7
|
-
s.mail_from_address
|
8
|
-
s.
|
9
|
-
s.
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
7
|
+
s.name = 'Spree Demo Site'
|
8
|
+
s.code = 'spree'
|
9
|
+
s.url = Rails.application.routes.default_url_options[:host] || 'demo.spreecommerce.org'
|
10
|
+
s.mail_from_address = 'no-reply@example.com'
|
11
|
+
s.customer_support_email = 'support@example.com'
|
12
|
+
s.default_currency = 'USD'
|
13
|
+
s.default_country_id = Spree::Config[:default_country_id]
|
14
|
+
s.seo_title = 'Spree Commerce Demo Shop'
|
15
|
+
s.meta_description = 'This is the new Spree UX DEMO | OVERVIEW: http://bit.ly/new-spree-ux | DOCS: http://bit.ly/spree-ux-customization-docs | CONTACT: https://spreecommerce.org/contact/'
|
16
|
+
s.facebook = 'spreecommerce'
|
17
|
+
s.twitter = 'spreecommerce'
|
18
|
+
s.instagram = 'spreecommerce'
|
14
19
|
end.save!
|
15
20
|
end
|
data/db/default/spree/zones.rb
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
middle_east.zone_members.where(zoneable: Spree::Country.find_by!(iso: name)).first_or_create!
|
17
17
|
end
|
18
18
|
|
19
|
-
%w(AF AM AZ BH BD BT BN KH CN CX CC
|
19
|
+
%w(AF AM AZ BH BD BT BN KH CN CX CC GE HK IN ID IR IQ IL JP JO KZ KW KG LA LB MO MY MV MN MM NP
|
20
20
|
KP OM PK PS PH QA SA SG KR LK SY TW TJ TH TR TM AE UZ VN YE).each do |name|
|
21
21
|
asia.zone_members.where(zoneable: Spree::Country.find_by!(iso: name)).first_or_create!
|
22
22
|
end
|
@@ -28,7 +28,7 @@ class CreateStoreFromPreferences < ActiveRecord::Migration[4.2]
|
|
28
28
|
end
|
29
29
|
|
30
30
|
s.meta_description = preference_store.get('spree/app_configuration/default_meta_description') do
|
31
|
-
'
|
31
|
+
'This is the new Spree UX DEMO | OVERVIEW: http://bit.ly/new-spree-ux | DOCS: http://bit.ly/spree-ux-customization-docs | CONTACT: https://spreecommerce.org/contact/'
|
32
32
|
end
|
33
33
|
s.meta_keywords = preference_store.get('spree/app_configuration/default_meta_keywords') {}
|
34
34
|
s.seo_title = preference_store.get('spree/app_configuration/default_seo_title') do
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class AddSupportedCurrenciesToStore < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
unless column_exists?(:spree_stores, :supported_currencies)
|
4
|
+
add_column :spree_stores, :supported_currencies, :string
|
5
|
+
Spree::Store.all.each do |store|
|
6
|
+
store.update_attribute(:supported_currencies, store.default_currency)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -3,5 +3,8 @@ class AddSocialToSpreeStores < ActiveRecord::Migration[6.0]
|
|
3
3
|
add_column :spree_stores, :facebook, :string
|
4
4
|
add_column :spree_stores, :twitter, :string
|
5
5
|
add_column :spree_stores, :instagram, :string
|
6
|
+
|
7
|
+
# Fix cache issue #10381
|
8
|
+
Rails.cache.delete('default_store')
|
6
9
|
end
|
7
10
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class AddDefaultCountryIdToSpreeStore < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
unless column_exists?(:spree_stores, :default_country_id)
|
4
|
+
add_column :spree_stores, :default_country_id, :integer
|
5
|
+
Spree::Store.reset_column_information
|
6
|
+
Spree::Store.update_all(default_country_id: Spree::Config[:default_country_id])
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddFooterFieldsToSpreeStores < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
add_column :spree_stores, :description, :text unless column_exists?(:spree_stores, :description)
|
4
|
+
add_column :spree_stores, :address, :text unless column_exists?(:spree_stores, :address)
|
5
|
+
add_column :spree_stores, :contact_phone, :string unless column_exists?(:spree_stores, :contact_phone)
|
6
|
+
add_column :spree_stores, :contact_email, :string unless column_exists?(:spree_stores, :contact_email)
|
7
|
+
end
|
8
|
+
end
|
data/db/migrate/20200607161221_add_store_owner_order_notification_delivered_to_spree_orders.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
class AddStoreOwnerOrderNotificationDeliveredToSpreeOrders < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
unless column_exists?(:spree_orders, :store_owner_notification_delivered)
|
4
|
+
add_column :spree_orders, :store_owner_notification_delivered, :boolean
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
@@ -4,8 +4,6 @@
|
|
4
4
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
5
|
// the compiled file.
|
6
6
|
//
|
7
|
-
//= require jquery
|
8
|
-
//= require jquery_ujs
|
9
7
|
//= require spree/backend
|
10
8
|
<% unless options[:lib_name] == 'spree' || options[:lib_name] == 'spree/backend' %>
|
11
9
|
<% filename = "spree/backend/#{ options[:lib_name].gsub("/", "_") }" %>
|
@@ -4,8 +4,6 @@
|
|
4
4
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
5
|
// the compiled file.
|
6
6
|
//
|
7
|
-
//= require jquery
|
8
|
-
//= require jquery_ujs
|
9
7
|
//= require accounting.min
|
10
8
|
//= require spree/frontend
|
11
9
|
<% unless options[:lib_name] == 'spree' || options[:lib_name] == 'spree/frontend' %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'spree/core'
|
3
|
+
|
4
|
+
module Spree
|
5
|
+
class MailersPreviewGenerator < Rails::Generators::Base
|
6
|
+
desc 'Generates mailers preview for development proposes'
|
7
|
+
|
8
|
+
def self.source_paths
|
9
|
+
[
|
10
|
+
File.expand_path('templates', __dir__)
|
11
|
+
]
|
12
|
+
end
|
13
|
+
|
14
|
+
def copy_mailers_previews
|
15
|
+
preview_path = Rails.application.config.action_mailer.preview_path || 'test/mailers/previews'
|
16
|
+
|
17
|
+
template 'mailers/previews/order_preview.rb', "#{preview_path}/order_preview.rb"
|
18
|
+
template 'mailers/previews/shipment_preview.rb', "#{preview_path}/shipment_preview.rb"
|
19
|
+
template 'mailers/previews/reimbursement_preview.rb', "#{preview_path}/reimbursement_preview.rb"
|
20
|
+
template 'mailers/previews/user_preview.rb', "#{preview_path}/user_preview.rb"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class OrderPreview < ActionMailer::Preview
|
2
|
+
def confirm_email
|
3
|
+
Spree::OrderMailer.confirm_email(Spree::Order.complete.first)
|
4
|
+
end
|
5
|
+
|
6
|
+
def cancel_email
|
7
|
+
Spree::OrderMailer.cancel_email(Spree::Order.complete.first)
|
8
|
+
end
|
9
|
+
|
10
|
+
def store_owner_notification_email
|
11
|
+
Spree::OrderMailer.store_owner_notification_email(Spree::Order.complete.first)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class UserPreview < ActionMailer::Preview
|
2
|
+
def reset_password_instructions
|
3
|
+
Spree::UserMailer.reset_password_instructions(Spree.user_class.first, 'your_token', { current_store_id: Spree::Store.default.id })
|
4
|
+
end
|
5
|
+
|
6
|
+
if Spree::Auth::Config[:confirmable]
|
7
|
+
def confirmation_instructions
|
8
|
+
Spree::UserMailer.confirmation_instructions(Spree.user_class.first, 'your_token')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/spree/core.rb
CHANGED
@@ -13,6 +13,7 @@ require 'premailer/rails'
|
|
13
13
|
require 'ransack'
|
14
14
|
require 'responders'
|
15
15
|
require 'state_machines-activerecord'
|
16
|
+
require 'active_storage_validations'
|
16
17
|
|
17
18
|
# This is required because ActiveModel::Validations#invalid? conflicts with the
|
18
19
|
# invalid state of a Payment. In the future this should be removed.
|
@@ -104,3 +105,4 @@ require 'spree/core/controller_helpers/order'
|
|
104
105
|
require 'spree/core/controller_helpers/search'
|
105
106
|
require 'spree/core/controller_helpers/store'
|
106
107
|
require 'spree/core/controller_helpers/strong_parameters'
|
108
|
+
require 'spree/core/controller_helpers/currency_helpers'
|
@@ -44,6 +44,7 @@ module Spree
|
|
44
44
|
|
45
45
|
def set_user_language
|
46
46
|
locale = session[:locale]
|
47
|
+
locale = store_locale if respond_to?(:store_locale, true) && locale.blank?
|
47
48
|
locale = config_locale if respond_to?(:config_locale, true) && locale.blank?
|
48
49
|
locale = Rails.application.config.i18n.default_locale if locale.blank?
|
49
50
|
locale = I18n.default_locale unless I18n.available_locales.map(&:to_s).include?(locale.to_s)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Spree
|
2
|
+
module Core
|
3
|
+
module ControllerHelpers
|
4
|
+
module CurrencyHelpers
|
5
|
+
def self.included(receiver)
|
6
|
+
receiver.send :helper_method, :supported_currencies
|
7
|
+
end
|
8
|
+
|
9
|
+
def supported_currencies
|
10
|
+
current_store.supported_currencies_list
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -52,10 +52,15 @@ module Spree
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def set_current_order
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
return unless try_spree_current_user && current_order
|
56
|
+
|
57
|
+
orders_scope = try_spree_current_user.orders.
|
58
|
+
incomplete.
|
59
|
+
where.not(id: current_order.id).
|
60
|
+
where(store_id: current_store.id)
|
61
|
+
|
62
|
+
orders_scope.each do |order|
|
63
|
+
current_order.merge!(order, try_spree_current_user)
|
59
64
|
end
|
60
65
|
end
|
61
66
|
|
@@ -5,13 +5,24 @@ module Spree
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
+
helper_method :supported_currencies
|
8
9
|
helper_method :current_currency
|
9
10
|
helper_method :current_store
|
10
11
|
helper_method :current_price_options
|
11
12
|
end
|
12
13
|
|
13
14
|
def current_currency
|
14
|
-
|
15
|
+
if defined?(session) && session.key?(:currency) && supported_currencies.map(&:iso_code).include?(session[:currency])
|
16
|
+
session[:currency]
|
17
|
+
elsif params[:currency].present? && supported_currencies.map(&:iso_code).include?(params[:currency])
|
18
|
+
params[:currency]
|
19
|
+
else
|
20
|
+
current_store.default_currency
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def supported_currencies
|
25
|
+
current_store.supported_currencies_list
|
15
26
|
end
|
16
27
|
|
17
28
|
def current_store
|
data/lib/spree/core/version.rb
CHANGED
@@ -33,7 +33,7 @@ module Spree
|
|
33
33
|
:id, :firstname, :lastname, :first_name, :last_name,
|
34
34
|
:address1, :address2, :city, :country_iso, :country_id, :state_id,
|
35
35
|
:zipcode, :phone, :state_name, :alternative_phone, :company,
|
36
|
-
:user_id, :deleted_at,
|
36
|
+
:user_id, :deleted_at, :label,
|
37
37
|
country: [:iso, :name, :iso3, :iso_name],
|
38
38
|
state: [:name, :abbr]
|
39
39
|
]
|
@@ -64,7 +64,7 @@ module Spree
|
|
64
64
|
:meta_keywords, :price, :sku, :deleted_at, :prototype_id,
|
65
65
|
:option_values_hash, :weight, :height, :width, :depth,
|
66
66
|
:shipping_category_id, :tax_category_id,
|
67
|
-
:cost_currency, :cost_price,
|
67
|
+
:cost_currency, :cost_price, :compare_at_price,
|
68
68
|
option_type_ids: [], taxon_ids: []
|
69
69
|
]
|
70
70
|
|
@@ -96,9 +96,12 @@ module Spree
|
|
96
96
|
:quantity, :stock_item, :stock_item_id, :originator, :action
|
97
97
|
]
|
98
98
|
|
99
|
-
@@store_attributes = [:name, :url, :seo_title, :code, :meta_keywords,
|
99
|
+
@@store_attributes = [:name, :url, :seo_title, :code, :meta_keywords, :logo,
|
100
100
|
:meta_description, :default_currency, :mail_from_address,
|
101
|
-
:facebook, :twitter, :instagram
|
101
|
+
:customer_support_email, :facebook, :twitter, :instagram,
|
102
|
+
:description, :address, :contact_email, :contact_phone,
|
103
|
+
:default_locale, :default_country_id, :supported_currencies,
|
104
|
+
:new_order_notifications_email, :mailer_logo]
|
102
105
|
|
103
106
|
@@store_credit_attributes = %i[amount currency category_id memo]
|
104
107
|
|
@@ -115,7 +118,7 @@ module Spree
|
|
115
118
|
@@variant_attributes = [
|
116
119
|
:name, :presentation, :cost_price, :discontinue_on, :lock_version,
|
117
120
|
:position, :track_inventory,
|
118
|
-
:product_id, :product, :option_values_attributes, :price,
|
121
|
+
:product_id, :product, :option_values_attributes, :price, :compare_at_price,
|
119
122
|
:weight, :height, :width, :depth, :sku, :cost_currency,
|
120
123
|
options: [:name, :value], option_value_ids: []
|
121
124
|
]
|