Skip to content

Commit

Permalink
Merge pull request Shopify#109 from rterbush/max-weights-master
Browse files Browse the repository at this point in the history
max_weight must return weight in ounces
  • Loading branch information
rterbush committed Aug 10, 2013
2 parents 97ede8c + 9816d93 commit c4f092e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/calculator/shipping/ups/base.rb
Expand Up @@ -22,7 +22,7 @@ def carrier
protected
# weight limit in ounces http://www.ups.com/content/us/en/resources/prepare/oversize.html
def max_weight_for_country(country)
150*Spree::ActiveShipping::Config[:unit_multiplier]
2400 # 150 lbs
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/calculator/shipping/usps/base.rb
Expand Up @@ -14,7 +14,7 @@ def carrier
protected
# weight limit in ounces or zero (if there is no limit)
def max_weight_for_country(country)
70*Spree::ActiveShipping::Config[:unit_multiplier]
1120 # 70 lbs
end
end
end
Expand Down
Expand Up @@ -34,7 +34,7 @@ def max_weight_for_country(country)
if limit.nil?
raise Spree::ShippingError.new("#{I18n.t(:shipping_error)}: This shipping method isn't available for #{country.name}")
end
limit*Spree::ActiveShipping::Config[:unit_multiplier]
limit * 16 # weights are operated on in ounces
end
end
end
Expand Down
Expand Up @@ -37,7 +37,7 @@ def max_weight_for_country(country)
if limit.nil?
raise Spree::ShippingError.new("#{I18n.t(:shipping_error)}: This shipping method isn't available for #{country.name}")
end
limit*Spree::ActiveShipping::Config[:unit_multiplier]
limit * 16 # weights are operated on in ounces
end
end
end
Expand Down
Expand Up @@ -26,7 +26,7 @@ def self.description
# weight limit in ounces http://pe.usps.com/text/imm/immc2_011.htm
def max_weight_for_country(country)
if AVAILABLE_COUNTRIES.include?(country.iso)
20*Spree::ActiveShipping::Config[:unit_multiplier]
320 # 20 lbs
else
# ex. AC, BO, CU, FK, KP, SO
raise Spree::ShippingError.new("#{I18n.t(:shipping_error)}: This shipping method isn't available for #{country.name}")
Expand Down
Expand Up @@ -26,7 +26,7 @@ def self.description
# weight limit in ounces http://pe.usps.com/text/imm/immc2_011.htm
def max_weight_for_country(country)
if AVAILABLE_COUNTRIES.include?(country.iso)
20*Spree::ActiveShipping::Config[:unit_multiplier]
320 # 20 lbs
else
# ex. AC, BO, CU, FK, KP, SO
raise Spree::ShippingError.new("#{I18n.t(:shipping_error)}: This shipping method isn't available for #{country.name}")
Expand Down
Expand Up @@ -26,7 +26,7 @@ def self.description
# weight limit in ounces http://pe.usps.com/text/imm/immc2_011.htm
def max_weight_for_country(country)
if AVAILABLE_COUNTRIES.include?(country.iso)
4*Spree::ActiveShipping::Config[:unit_multiplier]
64 # 4 lbs
else
# ex. North Korea, Somalia, etc.
raise Spree::ShippingError.new("#{I18n.t(:shipping_error)}: This shipping method isn't available for #{country.name}")
Expand Down

0 comments on commit c4f092e

Please sign in to comment.