From fcd68972404be7b4ecdcc3c91b53b2191c6515bb Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 26 Jun 2025 14:17:17 +1000 Subject: [PATCH] Prepare delivery details partial for conditional display --- .../checkout/_delivery_details.html.haml | 28 ++++++++++++++++++ app/views/checkout/_summary.html.haml | 29 +------------------ 2 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 app/views/checkout/_delivery_details.html.haml diff --git a/app/views/checkout/_delivery_details.html.haml b/app/views/checkout/_delivery_details.html.haml new file mode 100644 index 0000000000..2e8a75766b --- /dev/null +++ b/app/views/checkout/_delivery_details.html.haml @@ -0,0 +1,28 @@ +%div + .summary-subtitle + = t("checkout.step3.delivery_details.address") + %span + = @order.ship_address.firstname + = @order.ship_address.lastname + %div + = @order.ship_address.phone + %div + = @order.user.email if @order.user + %br + %div + = @order.ship_address.address1 + - unless @order.ship_address.address2.blank? + %div + = @order.ship_address.address2 + %div + = @order.ship_address.city + %div + = @order.ship_address.state + %div + = @order.ship_address.zipcode + %div + = @order.ship_address.country + - if @order.special_instructions.present? + %br + %em + = @order.special_instructions diff --git a/app/views/checkout/_summary.html.haml b/app/views/checkout/_summary.html.haml index 364a1f2570..6e4d98d2b0 100644 --- a/app/views/checkout/_summary.html.haml +++ b/app/views/checkout/_summary.html.haml @@ -11,34 +11,7 @@ = @order.shipping_method.name %em.fees= payment_or_shipping_price(@order.shipping_method, @order) .two-columns - %div - .summary-subtitle - = t("checkout.step3.delivery_details.address") - %span - = @order.ship_address.firstname - = @order.ship_address.lastname - %div - = @order.ship_address.phone - %div - = @order.user.email if @order.user - %br - %div - = @order.ship_address.address1 - - unless @order.ship_address.address2.blank? - %div - = @order.ship_address.address2 - %div - = @order.ship_address.city - %div - = @order.ship_address.state - %div - = @order.ship_address.zipcode - %div - = @order.ship_address.country - - if @order.special_instructions.present? - %br - %em - = @order.special_instructions + = render "delivery_details" - if @order.shipping_method.description.present? %div .summary-subtitle