solidus_core 2.10.0.beta1 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/helpers/spree/base_helper.rb +4 -4
- data/app/helpers/spree/products_helper.rb +2 -1
- data/app/jobs/spree/promotion_code_batch_job.rb +2 -2
- data/app/models/concerns/spree/user_methods.rb +2 -2
- data/app/models/spree/address.rb +11 -15
- data/app/models/spree/adjustment.rb +11 -0
- data/app/models/spree/calculator/price_sack.rb +1 -1
- data/app/models/spree/calculator/shipping/flexi_rate.rb +2 -2
- data/app/models/spree/calculator/tiered_flat_rate.rb +5 -5
- data/app/models/spree/calculator/tiered_percent.rb +6 -6
- data/app/models/spree/carton.rb +1 -1
- data/app/models/spree/credit_card.rb +2 -2
- data/app/models/spree/inventory_unit.rb +1 -19
- data/app/models/spree/line_item.rb +1 -1
- data/app/models/spree/order.rb +3 -2
- data/app/models/spree/order/checkout.rb +1 -1
- data/app/models/spree/order/payments.rb +2 -2
- data/app/models/spree/order_capturing.rb +2 -2
- data/app/models/spree/order_taxation.rb +2 -2
- data/app/models/spree/payment.rb +4 -41
- data/app/models/spree/payment/processing.rb +2 -2
- data/app/models/spree/payment_method.rb +2 -2
- data/app/models/spree/product.rb +3 -3
- data/app/models/spree/product/scopes.rb +8 -7
- data/app/models/spree/promotion.rb +27 -12
- data/app/models/spree/promotion/actions/create_quantity_adjustments.rb +1 -1
- data/app/models/spree/promotion/actions/free_shipping.rb +1 -1
- data/app/models/spree/promotion/rules/option_value.rb +2 -2
- data/app/models/spree/promotion/rules/product.rb +3 -3
- data/app/models/spree/promotion_action.rb +1 -1
- data/app/models/spree/promotion_chooser.rb +2 -2
- data/app/models/spree/promotion_code.rb +9 -8
- data/app/models/spree/promotion_code/batch_builder.rb +3 -3
- data/app/models/spree/promotion_rule.rb +1 -1
- data/app/models/spree/refund.rb +2 -2
- data/app/models/spree/reimbursement.rb +3 -11
- data/app/models/spree/reimbursement/reimbursement_type_engine.rb +1 -1
- data/app/models/spree/reimbursement_type/reimbursement_helpers.rb +2 -2
- data/app/models/spree/return_authorization.rb +1 -7
- data/app/models/spree/return_item.rb +3 -42
- data/app/models/spree/return_item/eligibility_validator/default.rb +1 -1
- data/app/models/spree/shipment.rb +4 -38
- data/app/models/spree/shipping_calculator.rb +0 -4
- data/app/models/spree/shipping_method.rb +1 -1
- data/app/models/spree/state.rb +1 -1
- data/app/models/spree/stock/differentiator.rb +1 -1
- data/app/models/spree/stock/package.rb +1 -1
- data/app/models/spree/stock_item.rb +1 -1
- data/app/models/spree/stock_quantities.rb +13 -12
- data/app/models/spree/tax_calculator/default.rb +0 -4
- data/app/models/spree/tax_calculator/shipping_rate.rb +0 -3
- data/app/models/spree/tax_rate.rb +4 -0
- data/app/models/spree/taxon/paperclip_attachment.rb +13 -0
- data/app/models/spree/user_last_url_storer.rb +46 -0
- data/app/models/spree/user_last_url_storer/rules/authentication_rule.rb +36 -0
- data/app/models/spree/variant.rb +9 -9
- data/app/models/spree/wallet/add_payment_sources_to_wallet.rb +1 -1
- data/app/models/spree/zone.rb +1 -1
- data/config/initializers/money.rb +2 -0
- data/config/locales/en.yml +12 -0
- data/lib/generators/spree/install/install_generator.rb +3 -0
- data/lib/generators/spree/install/templates/config/initializers/spree.rb.tt +8 -0
- data/lib/spree/app_configuration.rb +18 -3
- data/lib/spree/core.rb +12 -0
- data/lib/spree/core/controller_helpers/auth.rb +1 -13
- data/lib/spree/core/engine.rb +2 -2
- data/lib/spree/core/environment_extension.rb +9 -0
- data/lib/spree/core/importer/order.rb +26 -26
- data/lib/spree/core/product_filters.rb +15 -15
- data/lib/spree/core/role_configuration.rb +2 -2
- data/lib/spree/core/search/variant.rb +1 -1
- data/lib/spree/core/state_machines.rb +78 -0
- data/lib/spree/core/state_machines/inventory_unit.rb +42 -0
- data/lib/spree/core/state_machines/payment.rb +61 -0
- data/lib/spree/core/state_machines/reimbursement.rb +33 -0
- data/lib/spree/core/state_machines/return_authorization.rb +32 -0
- data/lib/spree/core/state_machines/return_item/acceptance_status.rb +51 -0
- data/lib/spree/core/state_machines/return_item/reception_status.rb +42 -0
- data/lib/spree/core/state_machines/shipment.rb +58 -0
- data/lib/spree/core/stock_configuration.rb +1 -0
- data/lib/spree/core/validators/email.rb +1 -8
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/money.rb +2 -2
- data/lib/spree/permission_sets/user_management.rb +3 -0
- data/lib/spree/permitted_attributes.rb +3 -3
- data/lib/spree/preferences/static_model_preferences.rb +2 -2
- data/lib/spree/testing_support/dummy_app.rb +4 -1
- data/lib/spree/testing_support/factories/inventory_unit_factory.rb +8 -1
- data/lib/spree/testing_support/factories/promotion_factory.rb +7 -0
- data/lib/spree/testing_support/factories/stock_package_factory.rb +1 -1
- data/solidus_core.gemspec +2 -2
- data/spec/lib/spree/core/environment_extension_spec.rb +12 -1
- data/spec/lib/spree/core/stock_configuration_spec.rb +36 -0
- data/spec/lib/spree/core/validators/email_spec.rb +18 -18
- data/spec/models/spree/address_spec.rb +23 -0
- data/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb +1 -1
- data/spec/models/spree/calculator/shipping/flat_rate_spec.rb +1 -1
- data/spec/models/spree/calculator/shipping/flexi_rate_spec.rb +2 -2
- data/spec/models/spree/calculator/shipping/per_item_spec.rb +1 -1
- data/spec/models/spree/calculator/shipping/price_sack_spec.rb +24 -15
- data/spec/models/spree/carton_spec.rb +8 -0
- data/spec/models/spree/classification_spec.rb +21 -9
- data/spec/models/spree/concerns/user_address_book_spec.rb +4 -4
- data/spec/models/spree/concerns/user_methods_spec.rb +2 -1
- data/spec/models/spree/order_merger_spec.rb +3 -3
- data/spec/models/spree/order_spec.rb +8 -15
- data/spec/models/spree/order_updater_spec.rb +4 -3
- data/spec/models/spree/payment_create_spec.rb +4 -14
- data/spec/models/spree/permission_sets/user_management_spec.rb +2 -0
- data/spec/models/spree/preference_spec.rb +4 -4
- data/spec/models/spree/preferences/preferable_spec.rb +3 -3
- data/spec/models/spree/preferences/statically_configurable_spec.rb +2 -2
- data/spec/models/spree/promotion_rule_spec.rb +6 -6
- data/spec/models/spree/promotion_spec.rb +73 -52
- data/spec/models/spree/reimbursement_type/original_payment_spec.rb +1 -1
- data/spec/models/spree/return_item/exchange_variant_eligibility/same_product_spec.rb +1 -1
- data/spec/models/spree/returns_calculator_spec.rb +2 -2
- data/spec/models/spree/shipping_calculator_spec.rb +1 -13
- data/spec/models/spree/shipping_method_spec.rb +32 -0
- data/spec/models/spree/stock/availability_validator_spec.rb +2 -2
- data/spec/models/spree/stock/differentiator_spec.rb +2 -2
- data/spec/models/spree/stock/estimator_spec.rb +3 -3
- data/spec/models/spree/stock/package_spec.rb +28 -28
- data/spec/models/spree/stock/simple_coordinator_spec.rb +11 -11
- data/spec/models/spree/stock/splitter/base_spec.rb +4 -4
- data/spec/models/spree/stock/splitter/shipping_category_spec.rb +7 -7
- data/spec/models/spree/stock_quantities_spec.rb +1 -1
- data/spec/models/spree/store_credit_spec.rb +1 -1
- data/spec/models/spree/tax_rate_spec.rb +1 -0
- data/spec/models/spree/taxons/paperclip_attachment_spec.rb +29 -0
- data/spec/models/spree/user_last_url_storer/rules/authentication_rule_spec.rb +31 -0
- data/spec/models/spree/user_last_url_storer_spec.rb +60 -0
- metadata +17 -12
- data/spec/migrate/20190106184413_remove_code_from_spree_promotions_spec.rb +0 -162
- data/spec/models/spree/order/updating_spec.rb +0 -18
@@ -2,10 +2,6 @@
|
|
2
2
|
|
3
3
|
module Spree
|
4
4
|
class ShippingCalculator < Calculator
|
5
|
-
def compute_shipment(_shipment)
|
6
|
-
raise NotImplementedError, "Please implement 'compute_shipment(shipment)' in your calculator: #{self.class.name}"
|
7
|
-
end
|
8
|
-
|
9
5
|
def compute_package(_package)
|
10
6
|
raise NotImplementedError, "Please implement 'compute_package(package)' in your calculator: #{self.class.name}"
|
11
7
|
end
|
@@ -41,7 +41,7 @@ module Spree
|
|
41
41
|
|
42
42
|
scope :available_to_store, ->(store) do
|
43
43
|
raise ArgumentError, "You must provide a store" if store.nil?
|
44
|
-
store.shipping_methods.empty? ? all : where(id: store.
|
44
|
+
store.shipping_methods.empty? ? all : where(id: store.shipping_methods.ids)
|
45
45
|
end
|
46
46
|
|
47
47
|
# @param shipping_category_ids [Array<Integer>] ids of desired shipping categories
|
data/app/models/spree/state.rb
CHANGED
@@ -24,7 +24,7 @@ module Spree
|
|
24
24
|
# table of { country.id => [ state.id , state.name ] }, arrays sorted by name
|
25
25
|
# blank is added elsewhere, if needed
|
26
26
|
def self.states_group_by_country_id
|
27
|
-
state_info = Hash.new { |
|
27
|
+
state_info = Hash.new { |hash, key| hash[key] = [] }
|
28
28
|
order(:name).each { |state|
|
29
29
|
state_info[state.country_id.to_s].push [state.id, state.name]
|
30
30
|
}
|
@@ -85,7 +85,7 @@ module Spree
|
|
85
85
|
# @return [Fixnum] the number of inventory units in the package,
|
86
86
|
# counting only those in the given state if it was specified
|
87
87
|
def quantity(state = nil)
|
88
|
-
matched_contents = state.nil? ? contents : contents.select { |
|
88
|
+
matched_contents = state.nil? ? contents : contents.select { |content| content.state.to_s == state.to_s }
|
89
89
|
matched_contents.map(&:quantity).sum
|
90
90
|
end
|
91
91
|
|
@@ -111,7 +111,7 @@ module Spree
|
|
111
111
|
def should_touch_variant?
|
112
112
|
# the variant_id changes from nil when a new stock location is added
|
113
113
|
inventory_cache_threshold &&
|
114
|
-
(saved_change_to_count_on_hand
|
114
|
+
(saved_change_to_count_on_hand&.any? { |cache| cache < inventory_cache_threshold }) ||
|
115
115
|
saved_change_to_variant_id?
|
116
116
|
end
|
117
117
|
|
@@ -8,8 +8,8 @@ module Spree
|
|
8
8
|
|
9
9
|
# @param quantities [Hash<Spree::Variant=>Numeric>]
|
10
10
|
def initialize(quantities = {})
|
11
|
-
raise ArgumentError unless quantities.keys.all?{ |
|
12
|
-
raise ArgumentError unless quantities.values.all?{ |
|
11
|
+
raise ArgumentError unless quantities.keys.all?{ |value| value.is_a?(Spree::Variant) }
|
12
|
+
raise ArgumentError unless quantities.values.all?{ |value| value.is_a?(Numeric) }
|
13
13
|
|
14
14
|
@quantities = quantities
|
15
15
|
end
|
@@ -33,16 +33,16 @@ module Spree
|
|
33
33
|
# Adds two StockQuantities together
|
34
34
|
# @return [Spree::StockQuantities]
|
35
35
|
def +(other)
|
36
|
-
combine_with(other) do |_variant,
|
37
|
-
(
|
36
|
+
combine_with(other) do |_variant, first, second|
|
37
|
+
(first || 0) + (second || 0)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
# Subtracts another StockQuantities from this one
|
42
42
|
# @return [Spree::StockQuantities]
|
43
43
|
def -(other)
|
44
|
-
combine_with(other) do |_variant,
|
45
|
-
(
|
44
|
+
combine_with(other) do |_variant, first, second|
|
45
|
+
(first || 0) - (second || 0)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -50,9 +50,10 @@ module Spree
|
|
50
50
|
# stock which exists in both StockQuantities.
|
51
51
|
# @return [Spree::StockQuantities]
|
52
52
|
def &(other)
|
53
|
-
combine_with(other) do |_variant,
|
54
|
-
next unless
|
55
|
-
|
53
|
+
combine_with(other) do |_variant, first, second|
|
54
|
+
next unless first && second
|
55
|
+
|
56
|
+
[first, second].min
|
56
57
|
end
|
57
58
|
end
|
58
59
|
|
@@ -72,9 +73,9 @@ module Spree
|
|
72
73
|
def combine_with(other)
|
73
74
|
self.class.new(
|
74
75
|
(variants | other.variants).map do |variant|
|
75
|
-
|
76
|
-
|
77
|
-
value = yield variant,
|
76
|
+
self_v = self[variant]
|
77
|
+
other_v = other[variant]
|
78
|
+
value = yield variant, self_v, other_v
|
78
79
|
[variant, value]
|
79
80
|
end.to_h.compact
|
80
81
|
)
|
@@ -8,10 +8,6 @@ module Spree
|
|
8
8
|
# The class used for tax calculation is configurable, so that the
|
9
9
|
# calculation can easily be pushed to third-party services. Users looking
|
10
10
|
# to provide their own calculator should adhere to the API of this class.
|
11
|
-
#
|
12
|
-
# @api experimental
|
13
|
-
# @note This API is currently in development and likely to change.
|
14
|
-
# Specifically, the input format is not yet finalized.
|
15
11
|
class Default
|
16
12
|
include Spree::Tax::TaxHelpers
|
17
13
|
|
@@ -10,9 +10,6 @@ module Spree
|
|
10
10
|
# class.
|
11
11
|
#
|
12
12
|
# @see Spree::Tax::ShippingRateTaxer
|
13
|
-
# @api experimental
|
14
|
-
# @note This API is currently in development and likely to change.
|
15
|
-
# Specifically, the input format is not yet finalized.
|
16
13
|
class ShippingRate
|
17
14
|
include Spree::Tax::TaxHelpers
|
18
15
|
|
@@ -88,7 +88,11 @@ module Spree
|
|
88
88
|
scope :included_in_price, -> { where(included_in_price: true) }
|
89
89
|
|
90
90
|
# Creates necessary tax adjustments for the order.
|
91
|
+
#
|
92
|
+
# @deprecated Please use `Spree::Tax::OrderAdjuster#adjust!` instead
|
91
93
|
def adjust(_order_tax_zone, item)
|
94
|
+
Spree::Deprecation.warn("`Spree::TaxRate#adjust` is deprecated. Please use `Spree::Tax::OrderAdjuster#adjust!` instead.", caller)
|
95
|
+
|
92
96
|
amount = compute_amount(item)
|
93
97
|
|
94
98
|
item.adjustments.create!(
|
@@ -18,4 +18,17 @@ module Spree::Taxon::PaperclipAttachment
|
|
18
18
|
def icon_present?
|
19
19
|
icon.present?
|
20
20
|
end
|
21
|
+
|
22
|
+
def attachment_partial_name
|
23
|
+
'paperclip'
|
24
|
+
end
|
25
|
+
|
26
|
+
def destroy_attachment(definition)
|
27
|
+
return false unless respond_to?(definition)
|
28
|
+
|
29
|
+
attached_file = send(definition)
|
30
|
+
return false unless attached_file.exists?
|
31
|
+
|
32
|
+
attached_file.destroy
|
33
|
+
end
|
21
34
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
# This service object is responsible for storing the current path into
|
5
|
+
# into `session[:spree_user_return_to]` for redirects after successful
|
6
|
+
# user/admin authentication.
|
7
|
+
class UserLastUrlStorer
|
8
|
+
# Lists all the rules that will be evaluated before storing the
|
9
|
+
# current path value into the session.
|
10
|
+
#
|
11
|
+
# @return [Spree::Core::ClassConstantizer::Set] a set of rules
|
12
|
+
# that, when matched, will prevent session[:spree_user_return_to]
|
13
|
+
# to be set
|
14
|
+
#
|
15
|
+
# @example This method can be used also to add more rules
|
16
|
+
# Spree::UserLastUrlStorer.rules << 'CustomRule'
|
17
|
+
#
|
18
|
+
# @example it can be used also for removing unwanted rules
|
19
|
+
# Spree::UserLastUrlStorer.rules.delete('CustomRule')
|
20
|
+
#
|
21
|
+
def self.rules
|
22
|
+
Spree::Config.user_last_url_storer_rules
|
23
|
+
end
|
24
|
+
|
25
|
+
# @param controller [ApplicationController] an instance of ApplicationController
|
26
|
+
# or its subclasses. The controller will be passed to each rule for matching.
|
27
|
+
def initialize(controller)
|
28
|
+
@controller = controller
|
29
|
+
end
|
30
|
+
|
31
|
+
# Stores into session[:spree_user_return_to] the request full path for
|
32
|
+
# future redirects (to be used after successful authentication). When
|
33
|
+
# there is a rule match then the request full path is not stored.
|
34
|
+
def store_location
|
35
|
+
return if self.class.rules.any? { |rule| rule.match? controller }
|
36
|
+
|
37
|
+
session[:spree_user_return_to] = request.fullpath.gsub('//', '/')
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
attr_reader :controller
|
43
|
+
|
44
|
+
delegate :session, :request, to: :controller
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
class UserLastUrlStorer
|
5
|
+
module Rules
|
6
|
+
# This is the basic rule that ships with Solidus that avoids storing in
|
7
|
+
# session the current path for login/loout/signup routes, avoiding possibly
|
8
|
+
# infinte redirects.
|
9
|
+
module AuthenticationRule
|
10
|
+
AUTHENTICATION_ROUTES = %w[spree_signup_path spree_login_path spree_logout_path]
|
11
|
+
|
12
|
+
extend self
|
13
|
+
|
14
|
+
def match?(controller)
|
15
|
+
full_path = controller.request.fullpath
|
16
|
+
disallowed_urls(controller).include?(full_path)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def disallowed_urls(controller)
|
22
|
+
@disallowed_urls ||= {}
|
23
|
+
@disallowed_urls[controller.controller_name] ||= begin
|
24
|
+
[].tap do |disallowed_urls|
|
25
|
+
AUTHENTICATION_ROUTES.each do |route|
|
26
|
+
if controller.respond_to?(route)
|
27
|
+
disallowed_urls << controller.send(route)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end.map! { |url| url[/\/\w+$/] }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/app/models/spree/variant.rb
CHANGED
@@ -250,12 +250,12 @@ module Spree
|
|
250
250
|
# no option values on master
|
251
251
|
return if is_master
|
252
252
|
|
253
|
-
option_type = Spree::OptionType.where(name: opt_name).first_or_initialize do |
|
254
|
-
|
255
|
-
|
253
|
+
option_type = Spree::OptionType.where(name: opt_name).first_or_initialize do |option|
|
254
|
+
option.presentation = opt_name
|
255
|
+
option.save!
|
256
256
|
end
|
257
257
|
|
258
|
-
current_value = option_values.detect { |
|
258
|
+
current_value = option_values.detect { |option| option.option_type.name == opt_name }
|
259
259
|
|
260
260
|
if current_value
|
261
261
|
return if current_value.name == opt_value
|
@@ -267,9 +267,9 @@ module Spree
|
|
267
267
|
end
|
268
268
|
end
|
269
269
|
|
270
|
-
option_value = Spree::OptionValue.where(option_type_id: option_type.id, name: opt_value).first_or_initialize do |
|
271
|
-
|
272
|
-
|
270
|
+
option_value = Spree::OptionValue.where(option_type_id: option_type.id, name: opt_value).first_or_initialize do |option|
|
271
|
+
option.presentation = opt_value
|
272
|
+
option.save!
|
273
273
|
end
|
274
274
|
|
275
275
|
option_values << option_value
|
@@ -281,7 +281,7 @@ module Spree
|
|
281
281
|
# @param opt_name [String] the name of the option whose value you want
|
282
282
|
# @return [String] the option value
|
283
283
|
def option_value(opt_name)
|
284
|
-
option_values.detect { |
|
284
|
+
option_values.detect { |option| option.option_type.name == opt_name }.try(:presentation)
|
285
285
|
end
|
286
286
|
|
287
287
|
# Returns an instance of the globally configured variant price selector class for this variant.
|
@@ -439,7 +439,7 @@ module Spree
|
|
439
439
|
end
|
440
440
|
|
441
441
|
def build_vat_prices
|
442
|
-
|
442
|
+
Spree::Config.variant_vat_prices_generator_class.new(self).run
|
443
443
|
end
|
444
444
|
|
445
445
|
def set_position
|
@@ -19,7 +19,7 @@ class Spree::Wallet::AddPaymentSourcesToWallet
|
|
19
19
|
sources = payments.map(&:source).
|
20
20
|
uniq.
|
21
21
|
compact.
|
22
|
-
select { |
|
22
|
+
select { |payment| payment.try(:reusable?) }
|
23
23
|
|
24
24
|
# add valid sources to wallet and optionally set a default
|
25
25
|
if sources.any?
|
data/app/models/spree/zone.rb
CHANGED
@@ -40,7 +40,7 @@ module Spree
|
|
40
40
|
end
|
41
41
|
|
42
42
|
alias :members :zone_members
|
43
|
-
accepts_nested_attributes_for :zone_members, allow_destroy: true, reject_if: proc { |
|
43
|
+
accepts_nested_attributes_for :zone_members, allow_destroy: true, reject_if: proc { |member| member['zoneable_id'].blank? }
|
44
44
|
|
45
45
|
self.whitelisted_ransackable_attributes = %w[name description]
|
46
46
|
|
data/config/locales/en.yml
CHANGED
@@ -1086,6 +1086,7 @@ en:
|
|
1086
1086
|
cannot_create_payment_without_payment_methods_html: You cannot create a payment
|
1087
1087
|
for an order without any payment methods defined. %{link}
|
1088
1088
|
cannot_create_returns: Cannot create returns as this order has no shipped units.
|
1089
|
+
cannot_edit_orders: You may only edit your current shopping cart.
|
1089
1090
|
cannot_perform_operation: Cannot perform requested operation
|
1090
1091
|
cannot_rebuild_shipments_order_completed: Cannot rebuild shipments for a completed
|
1091
1092
|
order.
|
@@ -1371,6 +1372,14 @@ en:
|
|
1371
1372
|
hidden: hidden
|
1372
1373
|
hide_out_of_stock: Hide out of stock
|
1373
1374
|
hints:
|
1375
|
+
spree/calculator:
|
1376
|
+
tax_rates: This is used to calculate both sales tax (United States-style taxes)
|
1377
|
+
and value-added tax (VAT). Typically this calculator should be the only tax
|
1378
|
+
calculator required by your store.
|
1379
|
+
shipping_methods: This is used to calculate the shipping rates on a per order or
|
1380
|
+
per package rate.
|
1381
|
+
promotions: This is used to determine the promotional discount to be applied to an
|
1382
|
+
order, an item, or shipping charges.
|
1374
1383
|
spree/price:
|
1375
1384
|
country: 'This determines in what country the price is valid.<br/>Default:
|
1376
1385
|
Any Country'
|
@@ -1519,6 +1528,7 @@ en:
|
|
1519
1528
|
log_entries: Log Entries
|
1520
1529
|
logged_in_as: Logged in as
|
1521
1530
|
logged_in_succesfully: Logged in successfully
|
1531
|
+
logged_in_successfully: Logged in successfully
|
1522
1532
|
logged_out: You have been logged out.
|
1523
1533
|
login: Login
|
1524
1534
|
login_as_existing: Login as Existing Customer
|
@@ -1548,6 +1558,7 @@ en:
|
|
1548
1558
|
meta_title: Meta Title
|
1549
1559
|
metadata: Metadata
|
1550
1560
|
minimal_amount: Minimal Amount
|
1561
|
+
minimize_menu: Minimize Menu
|
1551
1562
|
modify_stock_count: Modify (+/-)
|
1552
1563
|
month: Month
|
1553
1564
|
more: More
|
@@ -2103,6 +2114,7 @@ en:
|
|
2103
2114
|
(i.e. if the tax rate is 5% then enter 0.05)
|
2104
2115
|
tax_rates: Tax Rates
|
2105
2116
|
taxon: Taxon
|
2117
|
+
taxon_attachment_removal_error: There was an error removing the attachment
|
2106
2118
|
taxon_edit: Edit Taxon
|
2107
2119
|
taxon_placeholder: Add a Taxon
|
2108
2120
|
taxon_rule:
|
@@ -58,6 +58,9 @@ module Spree
|
|
58
58
|
|
59
59
|
def setup_assets
|
60
60
|
@lib_name = 'spree'
|
61
|
+
|
62
|
+
empty_directory 'app/assets/images'
|
63
|
+
|
61
64
|
%w{javascripts stylesheets images}.each do |path|
|
62
65
|
empty_directory "vendor/assets/#{path}/spree/frontend" if defined? Spree::Frontend || Rails.env.test?
|
63
66
|
empty_directory "vendor/assets/#{path}/spree/backend" if defined? Spree::Backend || Rails.env.test?
|
@@ -93,3 +93,11 @@ Spree.user_class = <%= (options[:user_class].blank? ? "Spree::LegacyUser" : opti
|
|
93
93
|
# just uncomment the following code and change it as you need.
|
94
94
|
#
|
95
95
|
# Spree::Model.whitelisted_ransackable_attributes << 'field'
|
96
|
+
|
97
|
+
# Rules for avoiding to store the current path into session for redirects
|
98
|
+
# When at least one rule is matched, the request path will not be stored
|
99
|
+
# in session.
|
100
|
+
# You can add your custom rules by uncommenting this line and changing
|
101
|
+
# the class name:
|
102
|
+
#
|
103
|
+
# Spree::UserLastUrlStorer.rules << 'Spree::UserLastUrlStorer::Rules::AuthenticationRule'
|
@@ -292,6 +292,14 @@ module Spree
|
|
292
292
|
|
293
293
|
class_name_attribute :variant_search_class, default: 'Spree::Core::Search::Variant'
|
294
294
|
|
295
|
+
# Allows implementing custom vat prices generation
|
296
|
+
# @!attribute [rw] variant_vat_prices_generator_class
|
297
|
+
# @see Spree::Variant::VatPriceGenerator
|
298
|
+
# @return [Class] an object that conforms to the API of
|
299
|
+
# the standard variant vat prices generator class
|
300
|
+
# Spree::Variant::VatPriceGenerator.
|
301
|
+
class_name_attribute :variant_vat_prices_generator_class, default: 'Spree::Variant::VatPriceGenerator'
|
302
|
+
|
295
303
|
# promotion_chooser_class allows extensions to provide their own PromotionChooser
|
296
304
|
class_name_attribute :promotion_chooser_class, default: 'Spree::PromotionChooser'
|
297
305
|
|
@@ -306,7 +314,6 @@ module Spree
|
|
306
314
|
# @!attribute [rw] shipping_rate_tax_calculator_class
|
307
315
|
# @return [Class] a class with the same public interfaces as
|
308
316
|
# Spree::TaxCalculator::ShippingRate
|
309
|
-
# @api experimental
|
310
317
|
class_name_attribute :shipping_rate_tax_calculator_class, default: 'Spree::TaxCalculator::ShippingRate'
|
311
318
|
|
312
319
|
# Allows providing your own Mailer for order mailer.
|
@@ -384,7 +391,6 @@ module Spree
|
|
384
391
|
# @!attribute [rw] tax_adjuster_class
|
385
392
|
# @return [Class] a class with the same public interfaces as
|
386
393
|
# Spree::Tax::OrderAdjuster
|
387
|
-
# @api experimental
|
388
394
|
class_name_attribute :tax_adjuster_class, default: 'Spree::Tax::OrderAdjuster'
|
389
395
|
|
390
396
|
# Allows providing your own class for calculating taxes on an order.
|
@@ -392,7 +398,6 @@ module Spree
|
|
392
398
|
# @!attribute [rw] tax_calculator_class
|
393
399
|
# @return [Class] a class with the same public interfaces as
|
394
400
|
# Spree::TaxCalculator::Default
|
395
|
-
# @api experimental
|
396
401
|
class_name_attribute :tax_calculator_class, default: 'Spree::TaxCalculator::Default'
|
397
402
|
|
398
403
|
# Allows providing your own class for choosing which store to use.
|
@@ -454,6 +459,10 @@ module Spree
|
|
454
459
|
@order_number_generator ||= Spree::Order::NumberGenerator.new
|
455
460
|
end
|
456
461
|
|
462
|
+
def state_machines
|
463
|
+
@state_machines ||= Spree::Core::StateMachines.new
|
464
|
+
end
|
465
|
+
|
457
466
|
def static_model_preferences
|
458
467
|
@static_model_preferences ||= Spree::Preferences::StaticModelPreferences.new
|
459
468
|
end
|
@@ -473,6 +482,12 @@ module Spree
|
|
473
482
|
@events_configuration ||= Spree::Event::Configuration.new
|
474
483
|
end
|
475
484
|
|
485
|
+
def user_last_url_storer_rules
|
486
|
+
@user_last_url_storer_rules ||= ::Spree::Core::ClassConstantizer::Set.new.tap do |set|
|
487
|
+
set << 'Spree::UserLastUrlStorer::Rules::AuthenticationRule'
|
488
|
+
end
|
489
|
+
end
|
490
|
+
|
476
491
|
def environment
|
477
492
|
@environment ||= Spree::Core::Environment.new(self).tap do |env|
|
478
493
|
env.calculators.promotion_actions_create_adjustments = %w[
|