valken-shipping 3.0.0.pre → 3.0.1.pre

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: 146a3ad0dd1b020312bcf880257b2d080cadd3bdfcb6205c1a63a79247ea080f
4
- data.tar.gz: 02edb837e0c27d4fba3ebce3f2e9545dd896c67f11dd00c865768144147977ea
3
+ metadata.gz: a1513e4c5c0a38b69af9f422bb6312fe996faa0928dd089d42c7288a31887a28
4
+ data.tar.gz: 1af97c1da52c7408dfbe7289a4d5754f5fb41ad4c2ead8ddc76049812f26a6ee
5
5
  SHA512:
6
- metadata.gz: ff8e88fc94268f6ea84ff2eb1d0d01ca4ea0f39609f92492feec006a9a01ea1e3fe9f2b4aaf50afa59badb0d1c9df3501f98bd468302c6b43be4e5a3065d90a7
7
- data.tar.gz: 67a511096848ef71c7a422d56342e63908f118b20f71ed5dc0196156c68355e2d8e3e537f36d13368c272920fb50c3f7dcfb8cf6fc82a6fd343fc8c4d678f64a
6
+ metadata.gz: 5d8150fc9f6cf02f0046882a65d5bdd07a5f375245834ae6474493bcfee8611f10dfff7e9a438cccc17860e897171b2046120f09aa4a97b4c337678438f5bbe7
7
+ data.tar.gz: 83c7a5f7e96bc89543c3a73552f2d20841b78e76d380f65f0d72e1b4cf963b20bfbb1b39d1a7149418506f67e0df5bc1ed712add24ba5ca4224cef47c88d327a
@@ -14,7 +14,9 @@ module Workarea
14
14
  end
15
15
 
16
16
  def no_of_packs
17
- (total_weight_lb / Workarea.config.max_weight_per_pack).ceil
17
+ packs_count = (total_weight_lb / Workarea.config.max_weight_per_pack).ceil
18
+
19
+ return packs_count == 0 ? 1 : packs_count
18
20
  end
19
21
 
20
22
  def find_shipping_sku(sku)
@@ -24,7 +26,7 @@ module Workarea
24
26
  def find_sku_weight(sku)
25
27
  product_by_sku = Catalog::Product.find_by_sku(sku).variants
26
28
  sku_data = product_by_sku.detect {|variant| variant.sku == sku }
27
- sku_weight = is_pounds(sku_data) ? convert_to_oz(sku_data.weight || 0) : (sku_data.weight || 0)
29
+ sku_weight = is_pounds(sku_data) ? convert_to_oz(sku_data.weight || 1) : (sku_data.weight || 1)
28
30
  sku_weight
29
31
  end
30
32
 
@@ -1,5 +1,5 @@
1
1
  module Valken
2
2
  module Shipping
3
- VERSION = '3.0.0.pre'
3
+ VERSION = '3.0.1.pre'
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: 3.0.0.pre
4
+ version: 3.0.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - sushmitha02