|
| 1 | +<div class="center jumbotron"> |
| 2 | + <p> |
| 3 | + Your Card => Total Items (<%= @cart.line_items.count %>) |
| 4 | + </p> |
| 5 | + <ul class="users"> |
| 6 | + <% @cart.line_items.each do |line_item| %> |
| 7 | + <%= render 'shared/product' , :product => line_item.product %> |
| 8 | + <li>Quantity: |
| 9 | + <%= line_item.quantity %> |
| 10 | + | Total Price: |
| 11 | + <%= number_to_currency(line_item.total_price) %> |
| 12 | + <!-- See lineItem section below for explanation of line_item links --> |
| 13 | + <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 %> |
| 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 |
| 27 | + <% end %> |
| 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 | + |
| 48 | +<% if(@current_cart.line_items.count !=0 ) %> |
| 49 | + |
| 50 | + <!-- See Order section below for explanation of new_order_path --> |
| 51 | + <%= link_to "Empty cart", cart_path(@current_cart),method: :delete, data: {confirm: "Are you sure?"} %> |
| 52 | + | |
| 53 | + <%= link_to "Proceed to checkout", new_order_path %> |
| 54 | +<% end %> |
| 55 | +</div> |
0 commit comments