valken-shipping 1.1.4 → 1.1.5
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: 7608c70f08d733b5da90794c417ad5bc0b70a85ec6250fe8803f97359e5d6f6a
|
4
|
+
data.tar.gz: d3ff069bfa00e8bba8e8ff3c5a286bd52d837062d8abaa08c0230c497346c439
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 140ef76ea1c80c5ecc8acc17e8553d725a648d005fd460e3b866224ac934c328637da2597c98f6bae5982a9bb0fcb6778fe78f6a646adfe485fa9659edb4f647
|
7
|
+
data.tar.gz: 601497d3f3e14b71ddd8efeadae6f9830d51d0ecb318e9a4d9b7b5329bc1f0f1be288aeefc9723a38252a0f1c0f8f877f2369d3d3b8fe6e8f18d7ba990f3b7cb
|
@@ -79,7 +79,8 @@ module Workarea
|
|
79
79
|
def get_free_shipping
|
80
80
|
ShippingOption.new(
|
81
81
|
carrier: "Free Shipping",
|
82
|
-
name: "
|
82
|
+
name: "Valken Economy",
|
83
|
+
sub_name: "5 - 9 Business Days",
|
83
84
|
service_code: "Free",
|
84
85
|
price: Money.new(0.0, "USD"),
|
85
86
|
tax_code: "TAX01"
|
@@ -104,7 +105,8 @@ module Workarea
|
|
104
105
|
|
105
106
|
ShippingOption.new(
|
106
107
|
carrier: "LTL Shipping",
|
107
|
-
name: "
|
108
|
+
name: "Valken Standard",
|
109
|
+
sub_name: "3 - 5 Business Days",
|
108
110
|
service_code: "LTL01",
|
109
111
|
price: Money.new(weight_price * 100, "USD"),
|
110
112
|
tax_code: "TAX01"
|
@@ -164,7 +166,7 @@ module Workarea
|
|
164
166
|
uniq_delivery_dates.each_with_index do |date, index|
|
165
167
|
selected_rates = rates.select {|rate| rate.delivery_date.present? && rate.delivery_date == date}
|
166
168
|
cheap_rate = selected_rates.sort_by(&:price).first
|
167
|
-
description = "#{cheap_rate.delivery_date.strftime('%
|
169
|
+
description = "#{cheap_rate.delivery_date.strftime('%A, %B %d, %Y')}"
|
168
170
|
shipping_option = create_shipping_options(cheap_rate, service_code[index], description)
|
169
171
|
filtered_rates.push(shipping_option)
|
170
172
|
end
|
@@ -175,7 +177,8 @@ module Workarea
|
|
175
177
|
def create_shipping_options(rate, rate_label = nil, description = nil)
|
176
178
|
ShippingOption.new(
|
177
179
|
carrier: rate.carrier,
|
178
|
-
name:
|
180
|
+
name: Workarea.config.shipping_rates[0].keys[0],
|
181
|
+
sub_name: Workarea.config.shipping_rates[0].values[0],
|
179
182
|
service_code: rate.service_code,
|
180
183
|
description: description,
|
181
184
|
price: Money.new(rate.price, rate.currency),
|
@@ -185,7 +188,5 @@ module Workarea
|
|
185
188
|
)
|
186
189
|
)
|
187
190
|
end
|
188
|
-
|
189
|
-
|
190
191
|
end
|
191
192
|
end
|
@@ -3,13 +3,12 @@ Workarea.configure do |config|
|
|
3
3
|
|
4
4
|
config.weight_table = {"2": 5, "15": 15, "200": 1, "2500": 200}
|
5
5
|
|
6
|
-
|
7
6
|
config.shipping_rates = [
|
8
|
-
"Overnight",
|
9
|
-
"2
|
10
|
-
"3
|
7
|
+
{"Valken Overnight" => "Overnight"},
|
8
|
+
{"Valken Express 2-Day" => "2 Business Days"},
|
9
|
+
{"Valken Express 3-Day" => "3 Business Days"}
|
11
10
|
]
|
12
|
-
config.ups_options = {"12"=> "3
|
13
|
-
config.fedex_options = {"STANDARD_OVERNIGHT"=> "Overnight", "FEDEX_2_DAY"=> "2
|
11
|
+
config.ups_options = {"12"=> "Valken Express 3-Day", "01"=> "Valken Overnight", "02"=> "Valken Express 2-Day"}
|
12
|
+
config.fedex_options = {"STANDARD_OVERNIGHT"=> "Valken Overnight", "FEDEX_2_DAY"=> "Valken Express 2-Day", "GROUND_HOME_DELIVERY"=> "Valken Express 3-Day"}
|
14
13
|
end
|
15
14
|
Valken::Shipping.auto_initialize_gateway
|