valken-shipping 2.0.6 → 2.0.7
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: bdf90fc1027419e570161039b4015727c9c98e2f48cb25c2dc386eaf97adfe08
|
4
|
+
data.tar.gz: 12b3131e650b4fd8ff8378c634d7a016490db586cece0559cdce26158b329d7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59bdeb5734e355f53fa91aac81c6b6ae747dd30c6c3772e6e59e6f0134e26d46c78897c11d849d829db41e8d1a39948d7d724d26d42d8f7dd104f51c1f33152a
|
7
|
+
data.tar.gz: 84e5b3769cb38a9b4f750443d081b419459667aa65bd0a9b5292210b194d2e05aebe1031c0c7c036555c03eb8d4db5292c70ddb69900d9d5b4ff9105ad985f86
|
@@ -12,7 +12,14 @@ module Workarea
|
|
12
12
|
.map { |id, region| [region.translations[I18n.locale.to_s] || region.name, id] }
|
13
13
|
.sort_by { |name, id| name || id }
|
14
14
|
|
15
|
-
|
15
|
+
if country.name == "United States of America"
|
16
|
+
region = regions.reject do |state|
|
17
|
+
Workarea.config.shipping_state_exclude.include?(state.last)
|
18
|
+
end
|
19
|
+
memo << [country.name, region]
|
20
|
+
else
|
21
|
+
memo << [country.name, regions]
|
22
|
+
end
|
16
23
|
memo
|
17
24
|
end
|
18
25
|
end
|
@@ -40,7 +47,6 @@ module Workarea
|
|
40
47
|
postalcode: address.postal_code,
|
41
48
|
country: address.country.alpha2
|
42
49
|
}
|
43
|
-
|
44
50
|
address_format = address.country.address_format || Country['US'].address_format
|
45
51
|
result = pieces.reduce(address_format) do |memo, (name, value)|
|
46
52
|
memo.gsub(/{{#{name}}}/, html_escape(value.to_s))
|
@@ -81,10 +81,9 @@ module Workarea
|
|
81
81
|
# If the carrier is ups then it will print ups data...or if carrier is fedex then prinnt fedex data...
|
82
82
|
# else if it is not both then choose cheapest price.
|
83
83
|
def collect_carrier_data
|
84
|
-
return get_ups_data
|
85
|
-
|
86
|
-
|
87
|
-
# return get_none_data unless is_ups && is_fedex
|
84
|
+
return get_ups_data if is_ups
|
85
|
+
return get_fedex_data if is_fedex
|
86
|
+
return get_none_data unless is_ups && is_fedex
|
88
87
|
end
|
89
88
|
|
90
89
|
# UPS data.
|
@@ -8,5 +8,10 @@ Workarea::Configuration.define_fields do
|
|
8
8
|
'ground_shipping_only' => 'ground shipping only'
|
9
9
|
},
|
10
10
|
description: 'Mapping of product details keys with shipping logic. Note: This maps only the keys not the values.'
|
11
|
+
|
12
|
+
field 'Shipping State Exclude',
|
13
|
+
type: :array,
|
14
|
+
default: ["AK", "HI", "PR"],
|
15
|
+
description: 'Shipping Excluded States'
|
11
16
|
end
|
12
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valken-shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sushmitha02
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.0.
|
75
|
+
rubygems_version: 3.0.6
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: shipping options
|