diff --git a/app/views/carts/show.html.erb b/app/views/carts/show.html.erb index 91951df76d..a49ac1cc26 100644 --- a/app/views/carts/show.html.erb +++ b/app/views/carts/show.html.erb @@ -17,7 +17,7 @@
<% @cart_total = 0 %> <% cart.each do |product_id, details| %> - <%= render 'item', product_id: product_id, details: details %> + <%= render 'itm', product_id: product_id, details: details %> <% end %> diff --git a/app/views/orders/_item.html.erb b/app/views/orders/_item.html.erb new file mode 100644 index 0000000000..fe1b1389ed --- /dev/null +++ b/app/views/orders/_item.html.erb @@ -0,0 +1,25 @@ +<% quantity = line_item.quantity %> + +<% if product = Product.find_by(id: line_item.product_id) %> + <% item_total = line_item.total_price %> + <% @cart_total += item_total %> +<%= product.description %>
+Product | +Unit Price | +Quantity | +Price | +|
---|---|---|---|---|
+ TOTAL: + | ++ <%= @cart_total %> + | +