valken-shipping 2.0.9 → 2.1.0
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: 21051b703831eeb8b7db181812b3231971498df95778ce15ba3a8ba27fde910e
|
4
|
+
data.tar.gz: 751fcb5af0f175a504a61b4b08fabd6ea1db859b3f5b23d6c914cbeb7febebf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39793ffff0a296b60c70221ed76fdb19c1d8516f853efe6e773e779622f4c09bf6badcdf84dafec9676ed2791aee8f1119bcd5b0393143b109a06722b43a0d99
|
7
|
+
data.tar.gz: aa0d815b9d042f655377f468d8679dfa5d6572fe7776a4536fd877e29a717b2aac9cb889569560c782a882955399df48dd6a3ec9e090ce2f14771bfb2842c67d
|
@@ -12,5 +12,36 @@ module Workarea
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
# if configuration ON, show the free shipping
|
16
|
+
# Need to add the free shipping upfront to all options so that we can use that to get discounts
|
17
|
+
# if the dicount is not available we are removing the free shipping option
|
18
|
+
def available
|
19
|
+
@available ||=
|
20
|
+
begin
|
21
|
+
all_options
|
22
|
+
all_options.unshift(get_free_shipping)
|
23
|
+
free_discount = price_adjustments["Valken Economy"]
|
24
|
+
if (free_discount.present? && free_discount.any?) || Workarea.config.show_free_shipping
|
25
|
+
all_options.first.price_adjustments = free_discount
|
26
|
+
else
|
27
|
+
all_options.shift()
|
28
|
+
end
|
29
|
+
all_options.each do |option|
|
30
|
+
option.price_adjustments = price_adjustments[option.name] || []
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_free_shipping
|
36
|
+
ShippingOption.new(
|
37
|
+
carrier: "Free Shipping",
|
38
|
+
name: "Valken Economy",
|
39
|
+
sub_name: "5 - 9 Business Days",
|
40
|
+
service_code: "Free",
|
41
|
+
price: Money.new(0.0, "USD"),
|
42
|
+
tax_code: "TAX01"
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
15
46
|
end
|
16
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sushmitha02
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -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.8
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: shipping options
|