Disable shipping options until PPX bug is sorted

This commit is contained in:
Brian Quinn 2010-01-25 11:28:55 +00:00
parent 69a75ff1a8
commit 9592c545a3
1 changed files with 20 additions and 19 deletions

View File

@ -252,25 +252,26 @@ module Spree::PaypalExpress
# hook to allow applications to load in their own shipping and handling costs # hook to allow applications to load in their own shipping and handling costs
def flat_rate_shipping_and_handling_options(order, stage) def flat_rate_shipping_and_handling_options(order, stage)
max_fallback = 0.0 # max_fallback = 0.0
shipping_options = ShippingMethod.all.map do |shipping_method| # shipping_options = ShippingMethod.all.map do |shipping_method|
max_fallback = shipping_method.fallback_amount if shipping_method.fallback_amount > max_fallback # max_fallback = shipping_method.fallback_amount if shipping_method.fallback_amount > max_fallback
{ :name => "#{shipping_method.id}", # { :name => "#{shipping_method.id}",
:label => "#{shipping_method.name} - #{shipping_method.zone.name}", # :label => "#{shipping_method.name} - #{shipping_method.zone.name}",
:amount => (shipping_method.fallback_amount*100) + 1, # :amount => (shipping_method.fallback_amount*100) + 1,
:default => shipping_method.is_default } # :default => shipping_method.is_default }
end # end
#
#
default_shipping_method = ShippingMethod.find(:first, :conditions => {:is_default => true}) # default_shipping_method = ShippingMethod.find(:first, :conditions => {:is_default => true})
#
opts = { :shipping_options => shipping_options, # opts = { :shipping_options => shipping_options,
:max_amount => (order.total + max_fallback)*100 # :max_amount => (order.total + max_fallback)*100
} # }
#
opts[:shipping] = (default_shipping_method.nil? ? 0 : default_shipping_method.fallback_amount) if stage == "checkout" # opts[:shipping] = (default_shipping_method.nil? ? 0 : default_shipping_method.fallback_amount) if stage == "checkout"
#
opts # opts
{}
end end
def gateway_error(response) def gateway_error(response)