solidus_frontend 3.0.3 → 3.1.3

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.

Potentially problematic release.


This version of solidus_frontend might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96539626adde6574b00a88af2e4dabbde2fb7323b6724637472a7fc01f1969b7
4
- data.tar.gz: 6ea7ed3bbca2e786f44ff798da59d5b2d342c2ce86698f4bdf996e30f327a7cb
3
+ metadata.gz: e140e0960c2907f6729fefb5612daa0b2c34f00693b9851ec3915229ebe672c2
4
+ data.tar.gz: 1860d27ebff4f5951f747a3a063e88611efa1f09378a52e1eb62ebc4b413405e
5
5
  SHA512:
6
- metadata.gz: d4bcff2dcb6fd4b18dcf484df2f638d167d92dbc6bb53b489ed96af6eccc45994d1891bb5cbdd25dd1c51ec486191e410b693b5b5c26299005bfd0249bee3804
7
- data.tar.gz: 14ee2d12accadac5cc809714b943d811ba476f10bccd54ac633369585d98c6bd7e26c3a487c7f46fdd2edd02862c908d53abbfdb61efac0c444ce33fb48084af
6
+ metadata.gz: 3e627e7dd00147a94c3f66858fb4126a42484161e6e09c1a53bae5011587972a37a3e9050aa1b4bfcc2cd59ca356dbc2e0089392c21fd174a3c935af64d48b9b
7
+ data.tar.gz: 2163e129731a803a1ff87081f452165dd4760980d7ae02199275c1a8a320e5dd66bdc85efd6d93355142615be0cb1f188ea20b928af00b815f2dd1f7a4ba5b20
@@ -3,12 +3,11 @@
3
3
  module Spree
4
4
  class LocaleController < Spree::StoreController
5
5
  def set
6
- available_locales = Spree.i18n_available_locales
7
6
  requested_locale = params[:switch_to_locale] || params[:locale]
8
7
 
9
- if requested_locale && available_locales.map(&:to_s).include?(requested_locale)
10
- session[set_user_language_locale_key] = requested_locale
8
+ if locale_is_available?(requested_locale)
11
9
  I18n.locale = requested_locale
10
+ session[set_user_language_locale_key] = requested_locale
12
11
  flash.notice = t('spree.locale_changed')
13
12
  else
14
13
  flash[:error] = t('spree.locale_not_changed')
@@ -16,5 +15,11 @@ module Spree
16
15
 
17
16
  redirect_to spree.root_path
18
17
  end
18
+
19
+ private
20
+
21
+ def locale_is_available?(locale)
22
+ locale && Spree.i18n_available_locales.include?(locale.to_sym)
23
+ end
19
24
  end
20
25
  end
@@ -7,7 +7,7 @@
7
7
  <ul>
8
8
  <% @product.variants_and_option_values_for(current_pricing_options).each_with_index do |variant, index| %>
9
9
  <li>
10
- <%= radio_button_tag "variant_id", variant.id, index == 0, 'data-price' => variant.price_for(current_pricing_options) %>
10
+ <%= radio_button_tag "variant_id", variant.id, index == 0, 'data-price' => variant.price_for_options(current_pricing_options)&.money %>
11
11
  <%= label_tag "variant_id_#{ variant.id }" do %>
12
12
  <span class="variant-description">
13
13
  <%= variant_options variant %>
@@ -28,13 +28,13 @@
28
28
  <%= hidden_field_tag "variant_id", @product.master.id %>
29
29
  <% end %>
30
30
 
31
- <% if @product.price_for(current_pricing_options) and !@product.price.nil? %>
31
+ <% if @product.price_for_options(current_pricing_options) and !@product.price.nil? %>
32
32
  <div data-hook="product_price" class="columns five <%= !@product.has_variants? ? 'alpha' : 'omega' %>">
33
33
 
34
34
  <div id="product-price">
35
35
  <h6 class="product-section-title"><%= t('spree.price') %></h6>
36
36
  <div>
37
- <span class="price selling" itemprop="price" content="<%= @product.price_for(current_pricing_options).to_d %>">
37
+ <span class="price selling" itemprop="price" content="<%= @product.price_for_options(current_pricing_options).amount %>">
38
38
  <%= display_price(@product) %>
39
39
  </span>
40
40
  <span itemprop="priceCurrency" content="<%= current_pricing_options.currency %>"></span>
@@ -32,7 +32,7 @@
32
32
  </div>
33
33
  <%= link_to truncate(product.name, length: 50), url, class: 'info', itemprop: "name", title: product.name %>
34
34
  <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
35
- <% if price = product.price_for(current_pricing_options) %>
35
+ <% if price = product.price_for_options(current_pricing_options)&.money %>
36
36
  <span class="price selling" itemprop="price" content="<%= price.to_d %>">
37
37
  <%= price.to_html %>
38
38
  </span>
@@ -10,6 +10,10 @@ module Spree
10
10
  # Leave initializer empty for backwards-compatability. Other apps
11
11
  # might still rely on this event.
12
12
  initializer "spree.frontend.environment", before: :load_config_initializers do; end
13
+
14
+ config.after_initialize do
15
+ Spree::Frontend::Config.check_load_defaults_called('Spree::Frontend::Config')
16
+ end
13
17
  end
14
18
  end
15
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.3
19
+ version: 3.1.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.3
26
+ version: 3.1.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: solidus_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.3
33
+ version: 3.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.0.3
40
+ version: 3.1.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement