Files
openfoodnetwork/app/views/checkout/_summary.html.haml
2025-09-10 09:59:47 +10:00

85 lines
3.5 KiB
Plaintext

= form_with url: checkout_update_path(checkout_step), model: @order, method: :put, data: { remote: "true", 'guest-checkout-target': 'summary' } do |f|
.summary-main
= render partial: "checkout/already_ordered" if show_bought_items? && checkout_step?(:summary)
.checkout-substep
.checkout-title
= t("checkout.step3.delivery_details.title")
%a.summary-edit{ href: main_app.checkout_step_path(:details), data: { action: "guest-checkout#removeUnloadEvent" } }
= t("checkout.step3.delivery_details.edit")
.summary-subtitle
= @order.shipping_method.name
%em.fees= payment_or_shipping_price(@order.shipping_method, @order)
.two-columns
= render "delivery_details" if @order.shipping_method.delivery?
- if @order.shipping_method.description.present?
%div
.summary-subtitle
= t("checkout.step3.delivery_details.instructions")
%div
= @order.shipping_method.description
%hr
.checkout-substep
.checkout-title
= t("checkout.step3.payment_method.title")
%a.summary-edit{ href: main_app.checkout_step_path(:payment), data: { action: "guest-checkout#removeUnloadEvent" } }
= t("checkout.step3.payment_method.edit")
.two-columns
- payment_method = last_payment_method(@order)
%div
- if payment_method
= payment_method.name
%em.fees
= payment_or_shipping_price(payment_method, @order)
- elsif @order.zero_priced_order?
%h4= t(:no_payment_required)
- if payment_method&.description.present?
%div
.summary-subtitle
= t("checkout.step3.payment_method.instructions")
%div
= payment_method&.description
.checkout-substep
.checkout-title
= t("checkout.step3.order.title")
%a.summary-edit{ href: main_app.cart_path, data: { action: "guest-checkout#removeUnloadEvent" } }
= t("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)
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
.summary-right-line
- if adjustment.originator_type == 'Voucher'
.summary-right-line-label.voucher
= "#{t(: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("checkout.step3.submit"), name: "confirm_order", class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false, data: { action: "click -> guest-checkout#removeUnloadEvent" }