flowcommerce_spree 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4805d4a464c5441b33c467972ef7750f5c350b6748dad10fb5a8d079e0c72b2c
|
4
|
+
data.tar.gz: dd5a4de7ff06de36712c55b4602d5eb6e490939978ec1bc71a15765393478229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465a5624b6a9e4a80732dca72a5d618f1cd14064fb3005212f25f7e9d687c2f2c48ab90992bcae145cb87a8de16bc33c37e5d924c545372fb31f0ff7f90df2d2
|
7
|
+
data.tar.gz: dcfc5356d0954104ab64c0d4da2282fd21cba1600613c84565734d50ed58bd1c1289bd936e3d8624f2703ed80a3e48c7af4ad20442041fb9dc590c3852839b37
|
@@ -6,14 +6,18 @@ CurrentZoneLoader.module_eval do
|
|
6
6
|
def current_zone
|
7
7
|
return @current_zone if defined?(@current_zone)
|
8
8
|
|
9
|
-
@current_zone = if (session_region_name = session['region']&.[](
|
9
|
+
@current_zone = if (session_region_name = session['region']&.[](:name))
|
10
10
|
Spree::Zones::Product.find_by(name: session_region_name, status: 'active')
|
11
11
|
end
|
12
12
|
|
13
|
-
@current_zone ||=
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
@current_zone ||= fetch_current_zone
|
14
|
+
@current_zone
|
15
|
+
end
|
16
|
+
|
17
|
+
def fetch_current_zone
|
18
|
+
if request_iso_code.present?
|
19
|
+
@current_zone = flow_zone || Spree::Country.find_by(iso: request_iso_code)&.product_zones&.active&.first
|
20
|
+
end
|
17
21
|
|
18
22
|
@current_zone ||= Spree::Zones::Product.find_by(name: 'International') ||
|
19
23
|
Spree::Zones::Product.new(name: 'International', taxon_ids: [], currencies: %w[USD CAD])
|
@@ -21,8 +25,8 @@ CurrentZoneLoader.module_eval do
|
|
21
25
|
current_zone_name = @current_zone.name
|
22
26
|
session['region'] = { name: current_zone_name, available_currencies: @current_zone.available_currencies,
|
23
27
|
request_iso_code: request_iso_code }
|
24
|
-
|
25
28
|
Rails.logger.debug("Using product zone: #{current_zone_name}")
|
29
|
+
|
26
30
|
@current_zone
|
27
31
|
end
|
28
32
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowcommerce_spree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aurel Branzeanu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-08-
|
12
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_model_serializers
|