mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
Improvement from upstream Spree commit. Brings a big performance boost to rendering, especially with larger numbers of items in the cart. 50%+ reduction in rendering times reported.
64 lines
2.4 KiB
Plaintext
64 lines
2.4 KiB
Plaintext
= render :partial => 'spree/shared/error_messages', :locals => { :target => @order }
|
|
|
|
.row
|
|
.columns.large-12
|
|
%table#cart-detail{"data-hook" => ""}
|
|
%col{halign: "left", valign: "middle", width: "60%"}/
|
|
%col{halign: "left", valign: "middle", width: "15%"}/
|
|
%col{halign: "center", valign: "middle", width: "10%"}/
|
|
%col{halign: "center", valign: "middle", width: "10%"}/
|
|
%col{halign: "center", valign: "middle", width: "5%"}/
|
|
%thead
|
|
%tr{"data-hook" => "cart_items_headers"}
|
|
%th.cart-item-description-header= t(:item)
|
|
%th.cart-item-price-header.text-right= t(:price)
|
|
%th.text-center.cart-item-quantity-header= t(:qty)
|
|
%th.cart-item-total-header.text-right= t(:total)
|
|
%th.cart-item-delete-header
|
|
|
|
%tbody#line_items{"data-hook" => ""}
|
|
= render partial: 'line_item', collection: order_form.object.line_items, locals: {order_form: order_form}
|
|
|
|
= render 'bought' if show_bought_items? && @order.cart?
|
|
|
|
%tfoot#edit-cart
|
|
= render 'spree/orders/form/cart_actions_row' if @order.cart?
|
|
|
|
%tr
|
|
%td.text-right{colspan:"3"}
|
|
= t :orders_form_subtotal
|
|
%td.text-right
|
|
%span.order-total.item-total= display_checkout_subtotal(@order)
|
|
%td
|
|
-if display_line_item_fees_total_for(@order) != Spree::Money.new(0 , currency: @order.currency)
|
|
%tr
|
|
%td.text-right{colspan:"3"}
|
|
= t :orders_form_admin
|
|
%td.text-right
|
|
%span.order-total.distribution-total= display_line_item_fees_total_for(@order)
|
|
%td
|
|
|
|
- checkout_adjustments_for(@order, exclude: [:line_item, :admin_and_handling]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
|
|
%tr.order-adjustment
|
|
%td.text-right{:colspan => "3"}
|
|
= adjustment.label
|
|
%td.text-right.total
|
|
%span= adjustment.display_amount.to_html
|
|
%td
|
|
|
|
%tr
|
|
%td.text-right{colspan:"3"}
|
|
%h5
|
|
= t :orders_form_total
|
|
%td.text-right
|
|
%h5.order-total.grand-total= @order.display_total
|
|
%td
|
|
|
|
- if @order.total_tax > 0
|
|
%tr
|
|
%td.text-right{colspan:"3"}
|
|
= t :order_includes_tax
|
|
%td.text-right
|
|
%span.order-total.tax-total= display_checkout_tax_total(@order)
|
|
%td
|