diff --git a/app/models/spree/shipment.rb b/app/models/spree/shipment.rb index 993fa0f62c..99d3a57fc0 100644 --- a/app/models/spree/shipment.rb +++ b/app/models/spree/shipment.rb @@ -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