mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Replay spree commit a4622ee13a723f0dba2943967b445b9989f67fb2 to fix issue introduced in spree 2.1
This commit is contained in:
@@ -107,11 +107,14 @@ module Spree
|
||||
def refresh_rates
|
||||
return shipping_rates if shipped?
|
||||
|
||||
# The call to Stock::Estimator below will replace the current shipping_method
|
||||
original_shipping_method_id = shipping_method.try(:id)
|
||||
|
||||
self.shipping_rates = OrderManagement::Stock::Estimator.new(order).shipping_rates(to_package)
|
||||
|
||||
if shipping_method
|
||||
if original_shipping_method_id
|
||||
selected_rate = shipping_rates.detect { |rate|
|
||||
rate.shipping_method_id == shipping_method.id
|
||||
rate.shipping_method_id == original_shipping_method_id
|
||||
}
|
||||
self.selected_shipping_rate_id = selected_rate.id if selected_rate
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user