From 937ba3ca0a4b6f5da0b459a9eab2ed8d7e11e20d Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 1 Aug 2021 10:16:55 +0100 Subject: [PATCH] Ensure previously selected shipping method is selected in form --- app/views/split_checkout/_details.html.haml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/split_checkout/_details.html.haml b/app/views/split_checkout/_details.html.haml index def4ae8ba1..eee3c61ea7 100644 --- a/app/views/split_checkout/_details.html.haml +++ b/app/views/split_checkout/_details.html.haml @@ -67,11 +67,13 @@ %div.checkout-title = t("split_checkout.step1.delivery_address.title") + - selected_shipping_method = @order.shipping_method&.id - @shipping_methods.each do |shipping_method| %div.checkout-input = fields_for shipping_method do |shipping_method_form| = shipping_method_form.radio_button :name, shipping_method.id, id: "shipping_method_#{shipping_method.id}", + checked: (shipping_method.id == selected_shipping_method), "data-description": shipping_method.description, "data-action": "toggle#toggle shippingmethod#selectShippingMethod", "data-toggle-show": shipping_method.require_ship_address