solidus_frontend 3.0.0 → 3.1.1

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: efca505352efdc61ad54ec4ac875c9fd16b62db6abe4c46ae12abeecfaf405dd
4
- data.tar.gz: c06399b590c2421361499238948b846210f254ffb4a68c91a9329a3eba963316
3
+ metadata.gz: f289929d3460d4484d300423868c64d4f858460257b8d2aad21178e0f0b45db9
4
+ data.tar.gz: 0f25b4c832ddcc38b7e19561f3a184eb8ca7c909c5bd2320eaf1d197f8b96e5f
5
5
  SHA512:
6
- metadata.gz: e0038661f1c4211ec84e4985d2cd6fbd4e63dac8c73046ea4f4a0772d516a02f1084c56df478b963c47595aa756e3b5295b825b06c96d35a810121115b45a9cf
7
- data.tar.gz: d97af5f5fad0a2ead939d81d6e81193ae9a7931881d57deb4340f3d36ce284cebafe02520f889e10fff3b4636d109bddf1e93f704f54de9272f457e021bbb117
6
+ metadata.gz: 67281d0cb334e3777d8da03288534edcd156d8249418856e96c8f3f5a2bbc0eea008432bae9ae4c7ff881d4d4d885188c7f9a0e7e880bcca9d10029afca9e9ce
7
+ data.tar.gz: 6ace3d8824f91576f9beee4d3cb284e7b17f9824b8f4c6b9c167ce619abf3bfdffc62c1eafe4f5e84ca9247d5849f8b819a86db67bc2e08e38180a196a3fe52e
@@ -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.0
4
+ version: 3.1.1
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-04-20 00:00:00.000000000 Z
11
+ date: 2021-09-20 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.0
19
+ version: 3.1.1
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.0
26
+ version: 3.1.1
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.0
33
+ version: 3.1.1
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.0
40
+ version: 3.1.1
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.2.20
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: Cart and storefront for the Solidus e-commerce project.