solidus_frontend 3.0.2 → 3.1.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_frontend might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18d412fff110d97ee160aa8f7bc83418eb585f10c4a8e1ed8a4b3d1abdb4dd2f
4
- data.tar.gz: 2b50f48fea6d6b4bd8bd7b5c7eb4068704a08fc089b41d596a4d53475d69ea57
3
+ metadata.gz: 62653584365f7feb30418391dae86ad065d9873f86edb921dec1432198f0c9d5
4
+ data.tar.gz: dcb5c77f653b65f24836cafbb04d88bf3a282d763e2b5b0416a39bd491efa8c4
5
5
  SHA512:
6
- metadata.gz: b9f0588e0fef4ae348febcb40dbe1a7486976fa82f3b1b0b83d8ed87ac5525a84e147e0f2aa9c00ce286139aed65b9dfec9464b9734d328c9ee67a3cce13fdb0
7
- data.tar.gz: 0d41c9a0131aa52669f147f1e216653a09db4d73770ef90136b97980f46c6f609299e231b1a642af69b3ce1817776db5b302f5f33d90b9ff902c40250eef41ea
6
+ metadata.gz: 9763134a7d86ff644b5e8025d2aa62c243bbcab708610d834451fe2304a4fb97105ef4c5758906861b7c27e3ffc74adec170653255902ef3eec5a0043d71e25a
7
+ data.tar.gz: aa17b59fe8c6967a4499cd1ddb871c8f043ce66d364dcbfbcd507e6757b13886cc3a5b1f26279726c23e9f2e7ac8790dae83a8cf52695fc836f05a1d5883dec7
@@ -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.2
4
+ version: 3.1.0
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.2
19
+ version: 3.1.0
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.2
26
+ version: 3.1.0
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.2
33
+ version: 3.1.0
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.2
40
+ version: 3.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement