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: facbbed02fb6c396fc8d3ac4b5337f594e2de0cbe20e8fd37b0ff7306a447ad5
4
- data.tar.gz: 96c4bd79d896be2a57108a03ee97eb79ba9115899fa0697cf48d7ba4e22cdaf9
3
+ metadata.gz: bdf90fc1027419e570161039b4015727c9c98e2f48cb25c2dc386eaf97adfe08
4
+ data.tar.gz: 12b3131e650b4fd8ff8378c634d7a016490db586cece0559cdce26158b329d7b
5
5
  SHA512:
6
- metadata.gz: 8a787f46ac3afab8fb25d440947ed897fe6bbae8e5c24166ef4446bbbe7144e9e2784dc64144bf90ab27a04245ca62ca75a071584e03d405ba24fcb8735afcfa
7
- data.tar.gz: 7ca413454ff6e3d406101074318ea9e3313d051f676fd1a1b69ddc66d1d2aff0c40d9ecf64fb35a1680b27726071f4e37e076d3a1778fe24f8ceb24d1af51e7f
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
- memo << [country.name, regions]
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
- # Temporarily disabling fedex and cheaper
86
- # return get_fedex_data if is_fedex
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
@@ -1,5 +1,5 @@
1
1
  module Valken
2
2
  module Shipping
3
- VERSION = '2.0.6'
3
+ VERSION = '2.0.7'
4
4
  end
5
5
  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.6
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.8
75
+ rubygems_version: 3.0.6
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: shipping options