From 200ced62fb02d119f1bc49dacef6a1986e2faf76 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Tue, 20 Jul 2021 15:46:15 +0200 Subject: [PATCH] Load shipping methods in the Controller needed to populate the form --- app/controllers/split_checkout_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index 0dec1b5951..483c99834a 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -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