diff --git a/app/views/split_checkout/_details.html.haml b/app/views/split_checkout/_details.html.haml index e81c8c08a7..53b4e29fdd 100644 --- a/app/views/split_checkout/_details.html.haml +++ b/app/views/split_checkout/_details.html.haml @@ -1,155 +1,156 @@ -.medium-6 - = f.fields :bill_address, model: @order.bill_address do |bill_address| - %div.checkout-substep - -# YOUR DETAILS - %div.checkout-title - = t("split_checkout.step1.contact_information.title") += form_with url: checkout_update_path(checkout_step), model: @order, method: :put, data: { remote: "true" } do |f| + .medium-6 + = f.fields :bill_address, model: @order.bill_address do |bill_address| + %div.checkout-substep + -# YOUR DETAILS + %div.checkout-title + = t("split_checkout.step1.contact_information.title") - .two-columns-inputs - %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } - = f.label :email, t("split_checkout.step1.contact_information.email.label") - = f.text_field :email, { placeholder: " " } - = f.error_message_on :email + .two-columns-inputs + %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } + = f.label :email, t("split_checkout.step1.contact_information.email.label") + = f.text_field :email, { placeholder: " " } + = f.error_message_on :email - %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } - = bill_address.label :phone, t("split_checkout.step1.contact_information.phone.label") - = bill_address.text_field :phone, { placeholder: " " } - = f.error_message_on "bill_address.phone" + %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } + = bill_address.label :phone, t("split_checkout.step1.contact_information.phone.label") + = bill_address.text_field :phone, { placeholder: " " } + = f.error_message_on "bill_address.phone" - %div.checkout-substep - -# BILLING ADDRESS - %div.checkout-title - = t("split_checkout.step1.billing_address.title") + %div.checkout-substep + -# BILLING ADDRESS + %div.checkout-title + = t("split_checkout.step1.billing_address.title") - .two-columns-inputs - %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } - = bill_address.label :firstname, t("split_checkout.step1.billing_address.first_name.label") - = bill_address.text_field :firstname, { placeholder: " " } - = f.error_message_on "bill_address.firstname" + .two-columns-inputs + %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } + = bill_address.label :firstname, t("split_checkout.step1.billing_address.first_name.label") + = bill_address.text_field :firstname, { placeholder: " " } + = f.error_message_on "bill_address.firstname" - %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } - = bill_address.label :lastname, t("split_checkout.step1.billing_address.last_name.label") - = bill_address.text_field :lastname, { placeholder: " " } - = f.error_message_on "bill_address.lastname" - - %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = bill_address.label :address1, t("split_checkout.step1.address.address1.label") - = bill_address.text_field :address1, { placeholder: " " } - = f.error_message_on "bill_address.address1" - - %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = bill_address.label :address2, t("split_checkout.step1.address.address2.label") - = bill_address.text_field :address2, { placeholder: " " } - = f.error_message_on "bill_address.address2" - - %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = bill_address.label :city, t("split_checkout.step1.address.city.label") - = bill_address.text_field :city, { placeholder: " " } - = f.error_message_on "bill_address.city" - - %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = bill_address.label :zipcode, t("split_checkout.step1.address.zipcode.label") - = bill_address.text_field :zipcode, { placeholder: " " } - = f.error_message_on "bill_address.zipcode" - - %div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states } - - bill_address_country = @order.bill_address.country || DefaultCountry.country - - %div.checkout-input - = bill_address.label :country_id, t("split_checkout.step1.address.country_id.label") - = bill_address.select :country_id, countries, { selected: bill_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" } - - %div.checkout-input - = bill_address.label :state_id, t("split_checkout.step1.address.state_id.label") - = bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependent-select-target": "select" } - - - if spree_current_user - %div.checkout-input - = f.check_box :save_bill_address - = f.label :save_bill_address, t(:checkout_default_bill_address) - - %div.checkout-substep{ "data-controller": "toggle shippingmethod" } - - selected_shipping_method = @order.shipping_method&.id || params[:shipping_method_id] - %div.checkout-title - = t("split_checkout.step1.shipping_info.title") - - - display_ship_address = false - - ship_method_description = nil - - - selected_shipping_method ||= @shipping_methods[0].id if @shipping_methods.length == 1 - - @shipping_methods.each do |shipping_method| - - ship_method_is_selected = shipping_method.id == selected_shipping_method.to_i - %div.checkout-input.checkout-input-radio - = fields_for shipping_method do |shipping_method_form| - = shipping_method_form.radio_button :name, shipping_method.id, - id: "shipping_method_#{shipping_method.id}", - checked: ship_method_is_selected, - name: "shipping_method_id", - "data-requireAddress": shipping_method.require_ship_address, - "data-action": "toggle#toggle shippingmethod#selectShippingMethod", - "data-toggle-show": shipping_method.require_ship_address - = shipping_method_form.label shipping_method.id, shipping_method.name, {for: "shipping_method_" + shipping_method.id.to_s } - %em.fees= payment_or_shipping_price(shipping_method, @order) - - display_ship_address = display_ship_address || (ship_method_is_selected && shipping_method.require_ship_address) - %div.checkout-input{"data-shippingmethod-target": "shippingMethodDescription", "data-shippingmethodid": shipping_method.id , style: "display: #{ship_method_is_selected ? 'block' : 'none'}" } - #distributor_address.panel - - if shipping_method.description.present? - %span #{shipping_method.description} - %br/ - %br/ - - if @order.order_cycle.pickup_time_for(@order.distributor) - = t :checkout_ready_for - = @order.order_cycle.pickup_time_for(@order.distributor) - - = f.error_message_on :shipping_method, standalone: true - - %div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" } - = f.check_box :ship_address_same_as_billing, { id: "ship_address_same_as_billing", name: "ship_address_same_as_billing", "data-action": "shippingmethod#showHideShippingAddress", "data-shippingmethod-target": "shippingAddressCheckbox", checked: shipping_and_billing_match?(@order) }, 1, nil - = f.label :ship_address_same_as_billing, t(:checkout_address_same), { for: "ship_address_same_as_billing" } - - %div{"data-shippingmethod-target": "shippingMethodAddress", style: "display: #{!display_ship_address || shipping_and_billing_match?(@order) ? 'none' : 'block'}" } - = f.fields :ship_address, model: @order.ship_address do |ship_address| - %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = ship_address.label :address1, t("split_checkout.step1.address.address1.label") - = ship_address.text_field :address1, { placeholder: " " } - = f.error_message_on "ship_address.address1" + %div.checkout-input.with-floating-label{ "data-controller": "floating-label" } + = bill_address.label :lastname, t("split_checkout.step1.billing_address.last_name.label") + = bill_address.text_field :lastname, { placeholder: " " } + = f.error_message_on "bill_address.lastname" %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = ship_address.label :address2, t("split_checkout.step1.address.address2.label") - = ship_address.text_field :address2, { placeholder: " " } - = f.error_message_on "ship_address.address2" + = bill_address.label :address1, t("split_checkout.step1.address.address1.label") + = bill_address.text_field :address1, { placeholder: " " } + = f.error_message_on "bill_address.address1" %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = ship_address.label :city, t("split_checkout.step1.address.city.label") - = ship_address.text_field :city, { placeholder: " " } - = f.error_message_on "ship_address.city" + = bill_address.label :address2, t("split_checkout.step1.address.address2.label") + = bill_address.text_field :address2, { placeholder: " " } + = f.error_message_on "bill_address.address2" %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} - = ship_address.label :zipcode, t("split_checkout.step1.address.zipcode.label") - = ship_address.text_field :zipcode, { placeholder: " " } - = f.error_message_on "ship_address.zipcode" + = bill_address.label :city, t("split_checkout.step1.address.city.label") + = bill_address.text_field :city, { placeholder: " " } + = f.error_message_on "bill_address.city" + + %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} + = bill_address.label :zipcode, t("split_checkout.step1.address.zipcode.label") + = bill_address.text_field :zipcode, { placeholder: " " } + = f.error_message_on "bill_address.zipcode" %div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states } - - ship_address_country = @order.ship_address.country || DefaultCountry.country + - bill_address_country = @order.bill_address.country || DefaultCountry.country %div.checkout-input - = ship_address.label :country_id, t("split_checkout.step1.address.country_id.label") - = ship_address.select :country_id, countries, { selected: ship_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" } + = bill_address.label :country_id, t("split_checkout.step1.address.country_id.label") + = bill_address.select :country_id, countries, { selected: bill_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" } %div.checkout-input - = ship_address.label :state_id, t("split_checkout.step1.address.state_id.label") - = ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_address&.state_id }, { "data-dependent-select-target": "select" } + = bill_address.label :state_id, t("split_checkout.step1.address.state_id.label") + = bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependent-select-target": "select" } + + - if spree_current_user + %div.checkout-input + = f.check_box :save_bill_address + = f.label :save_bill_address, t(:checkout_default_bill_address) + + %div.checkout-substep{ "data-controller": "toggle shippingmethod" } + - selected_shipping_method = @order.shipping_method&.id || params[:shipping_method_id] + %div.checkout-title + = t("split_checkout.step1.shipping_info.title") + + - display_ship_address = false + - ship_method_description = nil + + - selected_shipping_method ||= @shipping_methods[0].id if @shipping_methods.length == 1 + - @shipping_methods.each do |shipping_method| + - ship_method_is_selected = shipping_method.id == selected_shipping_method.to_i + %div.checkout-input.checkout-input-radio + = fields_for shipping_method do |shipping_method_form| + = shipping_method_form.radio_button :name, shipping_method.id, + id: "shipping_method_#{shipping_method.id}", + checked: ship_method_is_selected, + name: "shipping_method_id", + "data-requireAddress": shipping_method.require_ship_address, + "data-action": "toggle#toggle shippingmethod#selectShippingMethod", + "data-toggle-show": shipping_method.require_ship_address + = shipping_method_form.label shipping_method.id, shipping_method.name, {for: "shipping_method_" + shipping_method.id.to_s } + %em.fees= payment_or_shipping_price(shipping_method, @order) + - display_ship_address = display_ship_address || (ship_method_is_selected && shipping_method.require_ship_address) + %div.checkout-input{"data-shippingmethod-target": "shippingMethodDescription", "data-shippingmethodid": shipping_method.id , style: "display: #{ship_method_is_selected ? 'block' : 'none'}" } + #distributor_address.panel + - if shipping_method.description.present? + %span #{shipping_method.description} + %br/ + %br/ + - if @order.order_cycle.pickup_time_for(@order.distributor) + = t :checkout_ready_for + = @order.order_cycle.pickup_time_for(@order.distributor) + + = f.error_message_on :shipping_method, standalone: true - - if spree_current_user %div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" } - = f.check_box :save_ship_address - = f.label :save_ship_address, t(:checkout_default_ship_address) + = f.check_box :ship_address_same_as_billing, { id: "ship_address_same_as_billing", name: "ship_address_same_as_billing", "data-action": "shippingmethod#showHideShippingAddress", "data-shippingmethod-target": "shippingAddressCheckbox", checked: shipping_and_billing_match?(@order) }, 1, nil + = f.label :ship_address_same_as_billing, t(:checkout_address_same), { for: "ship_address_same_as_billing" } - .div.checkout-input - = f.label :special_instructions, t(:checkout_instructions) - = f.text_area :special_instructions, size: "60x4" + %div{"data-shippingmethod-target": "shippingMethodAddress", style: "display: #{!display_ship_address || shipping_and_billing_match?(@order) ? 'none' : 'block'}" } + = f.fields :ship_address, model: @order.ship_address do |ship_address| + %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} + = ship_address.label :address1, t("split_checkout.step1.address.address1.label") + = ship_address.text_field :address1, { placeholder: " " } + = f.error_message_on "ship_address.address1" - %div.checkout-submit - = f.submit t("split_checkout.step1.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false - %a.button.cancel{href: main_app.cart_path} - = t("split_checkout.step1.cancel") + %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} + = ship_address.label :address2, t("split_checkout.step1.address.address2.label") + = ship_address.text_field :address2, { placeholder: " " } + = f.error_message_on "ship_address.address2" + + %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} + = ship_address.label :city, t("split_checkout.step1.address.city.label") + = ship_address.text_field :city, { placeholder: " " } + = f.error_message_on "ship_address.city" + + %div.checkout-input.with-floating-label{ "data-controller": "floating-label"} + = ship_address.label :zipcode, t("split_checkout.step1.address.zipcode.label") + = ship_address.text_field :zipcode, { placeholder: " " } + = f.error_message_on "ship_address.zipcode" + + %div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states } + - ship_address_country = @order.ship_address.country || DefaultCountry.country + + %div.checkout-input + = ship_address.label :country_id, t("split_checkout.step1.address.country_id.label") + = ship_address.select :country_id, countries, { selected: ship_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" } + + %div.checkout-input + = ship_address.label :state_id, t("split_checkout.step1.address.state_id.label") + = ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_address&.state_id }, { "data-dependent-select-target": "select" } + + - if spree_current_user + %div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" } + = f.check_box :save_ship_address + = f.label :save_ship_address, t(:checkout_default_ship_address) + + .div.checkout-input + = f.label :special_instructions, t(:checkout_instructions) + = f.text_area :special_instructions, size: "60x4" + + %div.checkout-submit + = f.submit t("split_checkout.step1.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false + %a.button.cancel{href: main_app.cart_path} + = t("split_checkout.step1.cancel") diff --git a/app/views/split_checkout/_form.html.haml b/app/views/split_checkout/_form.html.haml index 0d32cac7c5..afedf10ebd 100644 --- a/app/views/split_checkout/_form.html.haml +++ b/app/views/split_checkout/_form.html.haml @@ -1,8 +1,5 @@ - content_for :injection_data do = inject_saved_credit_cards -%div.checkout-step{"class": if checkout_step?(:summary) then "checkout-summary" end} - = form_with url: checkout_update_path(checkout_step), model: @order, method: :put, - data: { remote: "true" } do |form| - - = render "split_checkout/#{checkout_step}", f: form +%div.checkout-step{ class: "#{'checkout-summary' if checkout_step?(:summary)}" } + = render "split_checkout/#{checkout_step}" diff --git a/app/views/split_checkout/_payment.html.haml b/app/views/split_checkout/_payment.html.haml index 82d3adcb3a..a85fe0d922 100644 --- a/app/views/split_checkout/_payment.html.haml +++ b/app/views/split_checkout/_payment.html.haml @@ -1,37 +1,38 @@ -.medium-6 - %div.checkout-substep{"data-controller": "paymentmethod"} - = render partial: "split_checkout/voucher_section", formats: [:cable_ready], locals: { order: @order, voucher_adjustment: @voucher_adjustment } - - %div.checkout-title - = t("split_checkout.step2.payment_method.title") += form_with url: checkout_update_path(checkout_step), model: @order, method: :put, data: { remote: "true" } do |f| + .medium-6 + %div.checkout-substep{"data-controller": "paymentmethod"} + = render partial: "split_checkout/voucher_section", formats: [:cable_ready], locals: { order: @order, voucher_adjustment: @voucher_adjustment } - - selected_payment_method = @order.payments&.with_state(:checkout)&.first&.payment_method_id - - selected_payment_method ||= available_payment_methods[0].id if available_payment_methods.length == 1 - - available_payment_methods.each do |payment_method| - %div.checkout-input.checkout-input-radio - = f.radio_button :payment_method_id, payment_method.id, - id: "payment_method_#{payment_method.id}", - name: "order[payments_attributes][][payment_method_id]", - checked: (payment_method.id == selected_payment_method), - "data-action": "paymentmethod#selectPaymentMethod", - "data-paymentmethod-id": "#{payment_method.id}", - "data-paymentmethod-target": "input" - = f.label :payment_method_id, "#{payment_method.name}", for: "payment_method_#{payment_method.id}" - %em.fees=payment_or_shipping_price(payment_method, @order) + %div.checkout-title + = t("split_checkout.step2.payment_method.title") - .paymentmethod-container{"data-paymentmethod-id": "#{payment_method.id}", style: "display: #{payment_method.id == selected_payment_method ? "block" : "none"}"} - - if payment_method.description && !payment_method.description.empty? - .paymentmethod-description.panel - #{payment_method.description} - .paymentmethod-form - = render partial: "split_checkout/payment/#{payment_method.method_type}", locals: { payment_method: payment_method, f: f } + - selected_payment_method = @order.payments&.with_state(:checkout)&.first&.payment_method_id + - selected_payment_method ||= available_payment_methods[0].id if available_payment_methods.length == 1 + - available_payment_methods.each do |payment_method| + %div.checkout-input.checkout-input-radio + = f.radio_button :payment_method_id, payment_method.id, + id: "payment_method_#{payment_method.id}", + name: "order[payments_attributes][][payment_method_id]", + checked: (payment_method.id == selected_payment_method), + "data-action": "paymentmethod#selectPaymentMethod", + "data-paymentmethod-id": "#{payment_method.id}", + "data-paymentmethod-target": "input" + = f.label :payment_method_id, "#{payment_method.name}", for: "payment_method_#{payment_method.id}" + %em.fees=payment_or_shipping_price(payment_method, @order) - = f.error_message_on :payment_method, standalone: true - - %div.checkout-substep - = t("split_checkout.step2.explaination") + .paymentmethod-container{"data-paymentmethod-id": "#{payment_method.id}", style: "display: #{payment_method.id == selected_payment_method ? "block" : "none"}"} + - if payment_method.description && !payment_method.description.empty? + .paymentmethod-description.panel + #{payment_method.description} + .paymentmethod-form + = render partial: "split_checkout/payment/#{payment_method.method_type}", locals: { payment_method: payment_method, f: f } - %div.checkout-submit - = f.submit t("split_checkout.step2.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false - %a.button.cancel{href: main_app.checkout_step_path(:details)} - = t("split_checkout.step2.cancel") + = f.error_message_on :payment_method, standalone: true + + %div.checkout-substep + = t("split_checkout.step2.explaination") + + %div.checkout-submit + = f.submit t("split_checkout.step2.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false + %a.button.cancel{href: main_app.checkout_step_path(:details)} + = t("split_checkout.step2.cancel") diff --git a/app/views/split_checkout/_summary.html.haml b/app/views/split_checkout/_summary.html.haml index e395bd7411..bd14fd3e7d 100644 --- a/app/views/split_checkout/_summary.html.haml +++ b/app/views/split_checkout/_summary.html.haml @@ -1,103 +1,104 @@ -.summary-main - = render partial: "split_checkout/already_ordered" if show_bought_items? && checkout_step?(:summary) - .checkout-substep - .checkout-title - = t("split_checkout.step3.delivery_details.title") - %a.summary-edit{href: main_app.checkout_step_path(:details)} - = t("split_checkout.step3.delivery_details.edit") += form_with url: checkout_update_path(checkout_step), model: @order, method: :put, data: { remote: "true" } do |f| + .summary-main + = render partial: "split_checkout/already_ordered" if show_bought_items? && checkout_step?(:summary) + .checkout-substep + .checkout-title + = t("split_checkout.step3.delivery_details.title") + %a.summary-edit{href: main_app.checkout_step_path(:details)} + = t("split_checkout.step3.delivery_details.edit") - .summary-subtitle - = @order.shipping_method.name - %em.fees= payment_or_shipping_price(@order.shipping_method, @order) - .two-columns - %div - .summary-subtitle - = t("split_checkout.step3.delivery_details.address") - %span - = @order.bill_address.firstname - = @order.bill_address.lastname - %div - = @order.bill_address.phone + .summary-subtitle + = @order.shipping_method.name + %em.fees= payment_or_shipping_price(@order.shipping_method, @order) + .two-columns %div - = @order.user.email if @order.user - %br - %div - = @order.bill_address.address1 - - unless @order.bill_address.address2.blank? + .summary-subtitle + = t("split_checkout.step3.delivery_details.address") + %span + = @order.bill_address.firstname + = @order.bill_address.lastname %div - = @order.bill_address.address2 - %div - = @order.bill_address.city - %div - = @order.bill_address.state - %div - = @order.bill_address.zipcode - %div - = @order.bill_address.country - - if @order.special_instructions.present? + = @order.bill_address.phone + %div + = @order.user.email if @order.user %br - %em - = @order.special_instructions - - if @order.shipping_method.description.present? - %div - .summary-subtitle - = t("split_checkout.step3.delivery_details.instructions") %div - = @order.shipping_method.description - - %hr - - .checkout-substep - .checkout-title - = t("split_checkout.step3.payment_method.title") - %a.summary-edit{href: main_app.checkout_step_path(:payment)} - = t("split_checkout.step3.payment_method.edit") - .two-columns - %div - - payment_method = last_payment_method(@order) - = payment_method&.name - %em.fees=payment_or_shipping_price(payment_method, @order) - - if payment_method&.description.present? - %div - .summary-subtitle - = t("split_checkout.step3.payment_method.instructions") + = @order.bill_address.address1 + - unless @order.bill_address.address2.blank? + %div + = @order.bill_address.address2 %div - = last_payment_method(@order)&.description + = @order.bill_address.city + %div + = @order.bill_address.state + %div + = @order.bill_address.zipcode + %div + = @order.bill_address.country + - if @order.special_instructions.present? + %br + %em + = @order.special_instructions + - if @order.shipping_method.description.present? + %div + .summary-subtitle + = t("split_checkout.step3.delivery_details.instructions") + %div + = @order.shipping_method.description + + %hr + + .checkout-substep + .checkout-title + = t("split_checkout.step3.payment_method.title") + %a.summary-edit{href: main_app.checkout_step_path(:payment)} + = t("split_checkout.step3.payment_method.edit") + .two-columns + %div + - payment_method = last_payment_method(@order) + = payment_method&.name + %em.fees=payment_or_shipping_price(payment_method, @order) + - if payment_method&.description.present? + %div + .summary-subtitle + = t("split_checkout.step3.payment_method.instructions") + %div + = last_payment_method(@order)&.description - %div.checkout-substep - %div.checkout-title - = t("split_checkout.step3.order.title") - %a.summary-edit{href: main_app.cart_path} - = t("split_checkout.step3.order.edit") - - = render 'spree/orders/summary', order: @order, display_footer: false + %div.checkout-substep + %div.checkout-title + = t("split_checkout.step3.order.title") + %a.summary-edit{href: main_app.cart_path} + = t("split_checkout.step3.order.edit") + + = render 'spree/orders/summary', order: @order, display_footer: false -.summary-right{ "data-controller": "sticky", "data-sticky-target": "container" } - .summary-right-line.total - .summary-right-line-label= t :order_total_price - .summary-right-line-value#order_total= @order.display_total.to_html - - .summary-right-line - .summary-right-line-label= t :order_produce - .summary-right-line-value= display_checkout_subtotal(@order) + .summary-right{ "data-controller": "sticky", "data-sticky-target": "container" } + .summary-right-line.total + .summary-right-line-label= t :order_total_price + .summary-right-line-value#order_total= @order.display_total.to_html - - checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment| .summary-right-line - -if adjustment.originator_type == 'Voucher' - .summary-right-line-label.voucher= adjustment.label - .summary-right-line-value.voucher= adjustment.display_amount.to_html - -else - .summary-right-line-label= adjustment.label - .summary-right-line-value= adjustment.display_amount.to_html + .summary-right-line-label= t :order_produce + .summary-right-line-value= display_checkout_subtotal(@order) - - if @order.total_tax > 0 - .summary-right-line - .summary-right-line-label= t :order_includes_tax - .summary-right-line-value#tax-row= display_checkout_tax_total(@order) - - .checkout-submit - - if any_terms_required?(@order.distributor) - = render partial: "terms_and_conditions", locals: { f: f } - = f.submit t("split_checkout.step3.submit"), name: "confirm_order", class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false + - checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment| + .summary-right-line + -if adjustment.originator_type == 'Voucher' + .summary-right-line-label.voucher= adjustment.label + .summary-right-line-value.voucher= adjustment.display_amount.to_html + -else + .summary-right-line-label= adjustment.label + .summary-right-line-value= adjustment.display_amount.to_html + + - if @order.total_tax > 0 + .summary-right-line + .summary-right-line-label= t :order_includes_tax + .summary-right-line-value#tax-row= display_checkout_tax_total(@order) + + .checkout-submit + - if any_terms_required?(@order.distributor) + = render partial: "terms_and_conditions", locals: { f: f } + = f.submit t("split_checkout.step3.submit"), name: "confirm_order", class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false