solidus_frontend 3.0.1 → 3.1.2

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: cf5e18acd4c8ecbcf2cf401eb50c46e6d6b5bd84c7ffe3704c0b298f1308c574
4
- data.tar.gz: 5f9cb36908fb080589a39cebf70da10c7ff38d2a023ee418e858aa73457dec58
3
+ metadata.gz: 56b88f80389643fc4578a3ec8ffe72e76fcee2314e43d0090d00eb7642d3c973
4
+ data.tar.gz: adf1607ab2f9fb5ebe8915b6acffbe2ef2f172f2bd39edb939f1623a8e04f745
5
5
  SHA512:
6
- metadata.gz: 8fd1a9c0f68b3f5e67644ba34f861ecbb5b3ce87b63c5aded1f5c490d6bd8a5dc06f6879e44bb330d14a923b70c05aff4097d85b82926f52bc61c1cd47d79733
7
- data.tar.gz: 10372dfccc8cc1885247b8e4063974fbecbde6e54cbe394a5dfe84df9c2a1ceaa9c532fd882114b192adbf7d21e1717db5d7404081372fc90ec2df395afc539e
6
+ metadata.gz: 42d221f8ffa233bc7ecb7120fbba65011045b3ce948b741fc763fbc7c4934be661f556241b16b201a12dbcf5db4609423ff49ae951e33286ed93bec0722cccef
7
+ data.tar.gz: bd87fbdecb7fa75fad17ace131d88ac6d28f8c7608e5aae9676f3b33bc2ee602eeedd99a2cb8e9f300b8d7db50240b92d8c5e198b200bfa6c49eb4e6130efc77
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-10 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.1
19
+ version: 3.1.2
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.1
26
+ version: 3.1.2
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.1
33
+ version: 3.1.2
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.1
40
+ version: 3.1.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -304,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
304
  - !ruby/object:Gem::Version
305
305
  version: 1.8.23
306
306
  requirements: []
307
- rubygems_version: 3.1.4
307
+ rubygems_version: 3.1.6
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: Cart and storefront for the Solidus e-commerce project.