diff --git a/app/controllers/spree/admin/orders/customer_details_controller.rb b/app/controllers/spree/admin/orders/customer_details_controller.rb index 5b4806c815..271b6b1b16 100644 --- a/app/controllers/spree/admin/orders/customer_details_controller.rb +++ b/app/controllers/spree/admin/orders/customer_details_controller.rb @@ -14,9 +14,7 @@ module Spree end def edit - country_id = Address.default.country.id - @order.build_bill_address(country_id: country_id) if @order.bill_address.nil? - @order.build_ship_address(country_id: country_id) if @order.ship_address.nil? + build_addresses end def update @@ -44,6 +42,12 @@ module Spree private + def build_addresses + country_id = Address.default.country.id + @order.build_bill_address(country_id: country_id) if @order.bill_address.nil? + @order.build_ship_address(country_id: country_id) if @order.ship_address.nil? + end + def refresh_shipment_rates @order.shipments.map(&:refresh_rates) end