Spree 1.1.2 compat. Adding specs for digital shipping
This commit is contained in:
@@ -10,12 +10,13 @@ Spree::Order.class_eval do
|
||||
false
|
||||
end
|
||||
|
||||
# UPGRADE_CHECK
|
||||
# TODO this works as of spree 1.1.1; make sure to check the original function on upgrade
|
||||
|
||||
def available_shipping_methods(display_on = nil)
|
||||
return [] unless ship_address
|
||||
all_methods = Spree::ShippingMethod.all_available(self, display_on)
|
||||
|
||||
puts "ALL METHODS #{all_methods.count} #{display_on}"
|
||||
if self.digital?
|
||||
all_methods.detect { |m| m.calculator.class == Spree::Calculator::DigitalDelivery }.try { |d| [d] } || all_methods
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user