|
|
|
@@ -1,9 +1,21 @@ |
|
|
|
<p id="notice"><%= notice %></p> |
|
|
|
|
|
|
|
<h2>Your Pragmatic Cart</h2> |
|
|
|
<h2>Your Cart</h2> |
|
|
|
|
|
|
|
<ul> |
|
|
|
<table> |
|
|
|
<% @cart.line_items.each do |item| %> |
|
|
|
<li><%= item.quantity %> × <%= item.product.title %></li> |
|
|
|
<tr> |
|
|
|
<td><%= item.quantity %> ×</td> |
|
|
|
<td><%= item.product.title %></td> |
|
|
|
<td class="item_price"><%= number_to_currency(item.total_price) %></td> |
|
|
|
</tr> |
|
|
|
<% end %> |
|
|
|
</ul> |
|
|
|
|
|
|
|
<tr class="total_line"> |
|
|
|
<td colspan="2">Total</td> |
|
|
|
<td class="total_cell"><%= number_to_currency(@cart.total_price) %></td> |
|
|
|
</tr> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
<%= button_to 'Empty Cart', @cart, method: :delete, data: { confirm: 'Are you sure?'} %> |