From 82ea33e9ca7835212534d526d98351f04b476920 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Wed, 25 Aug 2021 11:10:47 +0200 Subject: [PATCH] Do not display ship address form if not needed ie. the shipping method does not require any address --- app/views/split_checkout/_details.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/split_checkout/_details.html.haml b/app/views/split_checkout/_details.html.haml index b04ecd5ceb..d4eb29cee6 100644 --- a/app/views/split_checkout/_details.html.haml +++ b/app/views/split_checkout/_details.html.haml @@ -105,7 +105,7 @@ = f.check_box "Checkout.ship_address_same_as_billing", { id: "Checkout.ship_address_same_as_billing", "data-action": "shippingmethod#showHideShippingAddress", "data-shippingmethod-target": "shippingAddressCheckbox", checked: @ship_address_same_as_billing == "1" } = f.label "Checkout.ship_address_same_as_billing", t(:checkout_address_same), { for: "Checkout.ship_address_same_as_billing" } - %div{"data-shippingmethod-target": "shippingMethodAddress", style: "display: #{@ship_address_same_as_billing == "1" ? 'none' : 'block'}" } + %div{"data-shippingmethod-target": "shippingMethodAddress", style: "display: #{display_ship_address == false || @ship_address_same_as_billing == "1" ? 'none' : 'block'}" } = f.fields :ship_address, model: @order.ship_address do |ship_address| %div.checkout-input = ship_address.label :address1, t("split_checkout.step1.address.address1.label")