Copy admin/orders#edit from Spree controller

This method needs to be updated to use custom order advance logic in
service.
This commit is contained in:
Kristina Lim
2019-03-12 13:06:16 +08:00
parent f42eb3dab1
commit ce5691d080

View File

@@ -27,6 +27,18 @@ Spree::Admin::OrdersController.class_eval do
# within the page then fetches the data it needs from Api::OrdersController
end
def edit
@order.shipments.map &:refresh_rates
# Transition as far as we can go
while @order.next; end
# The payment step shows an error of 'No pending payments'
# Clearing the errors from the order object will stop this error
# appearing on the edit page where we don't want it to.
@order.errors.clear
end
# Re-implement spree method so that it redirects to edit instead of rendering edit
# This allows page reloads while adding variants to the order (/edit), without being redirected to customer details page (/update)
def update