Files
growstuff/app/views/orders/complete.html.haml
2017-02-08 07:25:59 +13:00

46 lines
761 B
Plaintext

- content_for :title, "Completed order"
%p Thank you for your order.
%p
%strong Completed at:
= @order.completed_at
%p
%strong Order number:
= @order.id
= render "shared/account_status"
%h2 Order items
%table.table.table-striped
%tr
%th Product
%th Price
%th Quantity
%th Subtotal
- total = 0
- @order.order_items.each do |i|
%tr
%td= i.product.name
%td
= price_with_currency(i.price)
%td= i.quantity
%td
- subtotal = i.price * i.quantity
- total += subtotal
= price_with_currency(subtotal)
%tr
%td
%td
%td
%strong Total:
%td
%strong
= price_with_currency(total)
%p
= link_to "View other orders/order history", orders_path