|
1 | 1 | <div class="center jumbotron"> |
2 | 2 | <p> |
3 | | - Card Show |
| 3 | + Your Card => Total Items (<%= @cart.line_items.count %>) |
4 | 4 | </p> |
5 | | - <p> |
6 | | - Total Items (<%= @cart.line_items.count %>) |
7 | | - </p> |
8 | | - <ul> |
| 5 | + <ul class="users"> |
9 | 6 | <% @cart.line_items.each do |line_item| %> |
10 | | - <li>Item: |
11 | | - <%= line_item.product.name %>/ Price: |
12 | | - <%= number_to_currency(line_item.product.price) %>/ Quantity: |
13 | | - <%= line_item.quantity %>/ Total Price: |
| 7 | + <%= render line_item.product %> |
| 8 | + <li>Quantity: |
| 9 | + <%= line_item.quantity %> |
| 10 | + | Total Price: |
14 | 11 | <%= number_to_currency(line_item.total_price) %> |
15 | 12 | <!-- See lineItem section below for explanation of line_item links --> |
16 | 13 | <ul> |
17 | | - <li> |
18 | | - <%= link_to "Add one", line_item_add_path(:id => line_item), method: :post %> |
19 | | - <%= link_to "Reduce one", line_item_reduce_path(:id => line_item), method: :post %> |
20 | | - </li> |
21 | | - <li> |
22 | | - <%= link_to "Remove item", line_item_path(line_item), method: :delete %> |
23 | | - </li> |
24 | | - </ul> |
| 14 | + <!-- <li> --> |
| 15 | + <!-- <%#= link_to "Add one", line_item_add_path(:id => line_item), method: :post %> --> |
| 16 | + |
| 17 | + <!-- reduce --> |
| 18 | + <%=link_to line_item_reduce_path(:id => line_item) , method: :post, class: "btn btn-danger" , style: "margin-top:15px;" do %> |
| 19 | + <i class="glyphicon glyphicon-minus" style="color:black;"></i> |
| 20 | + Reduce |
| 21 | + <% end %> |
25 | 22 |
|
| 23 | + <!-- add --> |
| 24 | + <%=link_to line_item_add_path(:id => line_item) , method: :post , class: "btn btn-success" , style: "margin-top:15px;" do %> |
| 25 | + <i class="glyphicon glyphicon-plus" style="color:black;"></i> |
| 26 | + Add |
26 | 27 | <% end %> |
27 | | - </ul> |
28 | | - <h3>Total price: |
29 | | - <%= number_to_currency(@cart.sub_total) %></h3> |
30 | | - <!-- See Order section below for explanation of new_order_path --> |
31 | | - <%= link_to "Empty cart", cart_path(@current_cart),method: :delete, data: {confirm: "Are you sure?"} %> |
32 | | - | |
33 | | - <%= link_to "Proceed to checkout", new_order_path %> |
| 28 | + |
| 29 | + <!-- Remove --> |
| 30 | + <%=link_to line_item_path(line_item) ,method: :delete ,class: "btn btn-warning" , style: "margin-top:15px;" do %> |
| 31 | + <i class="glyphicon glyphicon-remove" style="color:black;"></i> |
| 32 | + Remove Item |
| 33 | + <% end %> |
| 34 | + |
| 35 | + <!-- <%#= link_to "Reduce one", line_item_reduce_path(:id => line_item), method: :post %> --> |
| 36 | + <!-- </li> --> |
| 37 | + <!-- <li> --> |
| 38 | + <%#= link_to "Remove item", line_item_path(line_item), method: :delete %> |
| 39 | + <!-- </li> --> |
| 40 | + <hr /> |
| 41 | + </ul> |
| 42 | + |
| 43 | + <% end %> |
| 44 | +</ul> |
| 45 | +<h3>Total price: |
| 46 | +<%= number_to_currency(@cart.sub_total) %></h3> |
| 47 | +<!-- See Order section below for explanation of new_order_path --> |
| 48 | +<%= link_to "Empty cart", cart_path(@current_cart),method: :delete, data: {confirm: "Are you sure?"} %> |
| 49 | +| |
| 50 | +<%= link_to "Proceed to checkout", new_order_path %> |
34 | 51 | </div> |
0 commit comments