mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Remove clear_ship_address from checkout_controller because it is setting an empty address on order.ship_address which is breaking the reset_checkout process in some cases.
This logic is already repeated in the before_save hook in the OrderUpdater where the distributor address is put into the ship_address on order.finalize In cases the order is not to be finalized we keep the ship_address sent from the client as we may need it to make the order workflow work properly
This commit is contained in:
@@ -152,7 +152,6 @@ class CheckoutController < Spree::CheckoutController
|
||||
end
|
||||
|
||||
def update_failed
|
||||
clear_ship_address
|
||||
RestartCheckout.new(@order).call
|
||||
|
||||
respond_to do |format|
|
||||
@@ -165,15 +164,6 @@ class CheckoutController < Spree::CheckoutController
|
||||
end
|
||||
end
|
||||
|
||||
# When we have a pickup Shipping Method,
|
||||
# we clone the distributor address into ship_address before_save
|
||||
# We don't want this data in the form, so we clear it out
|
||||
def clear_ship_address
|
||||
unless current_order.shipping_method.andand.require_ship_address
|
||||
current_order.ship_address = Spree::Address.default
|
||||
end
|
||||
end
|
||||
|
||||
def load_order
|
||||
@order = current_order
|
||||
redirect_to(main_app.shop_path) && return unless @order && @order.checkout_allowed?
|
||||
|
||||
Reference in New Issue
Block a user