spree_temando 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
CHANGED
|
@@ -48,6 +48,10 @@ In the calculations, the extension always attempts to find the cheapest
|
|
|
48
48
|
quote, but when `Express` is selected, only the quotes with the smallest
|
|
49
49
|
`maximum_eta` are considered.
|
|
50
50
|
|
|
51
|
+
It's important to note that all products in the cart must have their
|
|
52
|
+
dimensions filled out (height, length, depth, weight), otherwise Temando
|
|
53
|
+
will not be able to quote.
|
|
54
|
+
|
|
51
55
|
## Notes
|
|
52
56
|
|
|
53
57
|
The extension only makes requests to the Temando API when the order
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
module SpreeTemando
|
|
2
2
|
module VariantShippingDecorator
|
|
3
|
+
def temando_quotable?
|
|
4
|
+
self.height.present? &&
|
|
5
|
+
self.depth.present? &&
|
|
6
|
+
self.width.present? &&
|
|
7
|
+
self.weight.present?
|
|
8
|
+
end
|
|
9
|
+
|
|
3
10
|
def to_temando_item
|
|
11
|
+
return nil unless self.temando_quotable?
|
|
4
12
|
item = Temando::Item::GeneralGoods.new
|
|
5
13
|
# NOTE: All the distances in Temando are in metres
|
|
6
14
|
item.height = (self.height / 100.0)
|