-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path@
55 lines (51 loc) · 1.29 KB
/
@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<% provide(:title, 'Cart') %>
<p id="notice"><%= notice %></p>
<h3>Shopping Cart</h3>
<p>
<b>Storekeeper:</b>
<%= current_storekeeper.name %>
</p>
<% if @cart.cart_items.any? %>
<table class="table table-striped table-bordered">
<tr>
<th>Name</th>
<th>Price</th>
<th>Store</th>
<th></th>
</tr>
<% @cart.cart_items.each do |item| %>
<% if Item.find_by_id(item.item_number) %>
<tr>
<td><%= item.item_name %></td>
<td>$<%= item.item_price %></td>
<td><%= item.store_name %></td>
<td><%= link_to "Delete", cart_destroy_url(:id => item.id) %></td>
</tr>
<% end %>
<% end %>
<tr>
<td></td>
<td>Total: $<%= @t %></td>
<td><%= link_to 'Checkout', checkout_url(:id => @cart.id), class: "btn btn-primary" %></td>
<td></td>
</table>
<% end %>
<% if current_storekeeper.saveds.any? %>
<table class="table table-striped table-bordered">
<tr>
<th>Name</th>
<th>Price</th>
<th>Store</th>
<th></th>
</tr>
<% current_storekeeper.saveds.each do |item| %>
<% if Item.find_by_id(item.item_number) %>
<tr>
<td><%= item.item_name %></td>
<td><%= item.item_price %></td>
<td><%= item.store_name %></td>
<td><%= link_to "Add to Cart", '#' %></td>
</tr>
<% end %>
<% end %>
<% end %>