Load shipping methods in the Controller

needed to populate the form
This commit is contained in:
Jean-Baptiste Bellet
2021-07-20 15:46:15 +02:00
parent 1076ec777c
commit 200ced62fb

View File

@@ -19,7 +19,7 @@ class SplitCheckoutController < ::BaseController
prepend_before_action :require_order_cycle
prepend_before_action :require_distributor_chosen
before_action :load_order
before_action :load_order, :load_shipping_methods
before_action :ensure_order_not_completed
before_action :ensure_checkout_allowed
@@ -91,6 +91,10 @@ class SplitCheckoutController < ::BaseController
redirect_to main_app.cart_path if @order.completed?
end
def load_shipping_methods
@shipping_methods = Spree::ShippingMethod.for_distributor(@order.distributor).order(:name)
end
def load_order
@order = current_order