Sha256: 53d22d2417d2016ec3e51542562d44a58112ac824f53e85b494a40792c95b52c
Contents?: true
Size: 1.66 KB
Versions: 52
Compression:
Stored size: 1.66 KB
Contents
<% if @cart.items.any? -%> <%= form_tag piggybak.cart_update_url do -%> <table cellpadding="5" cellspacing="0" width="100%"> <tr> <th id="item_col">Item</th> <th id="price_col">Price</th> <th id="quantity_col">Quantity</th> <th id="subtotal_col">Subtotal</th> <% if page == "cart" -%> <th></th> <% end -%> </tr> <% @cart.items.each do |item| %> <tr> <td><%= item[:variant].description %></td> <td><%= number_to_currency item[:variant].price %></td> <td> <% if page == "cart" -%> <%= text_field_tag "quantity[#{item[:variant].id}]", item[:quantity] %> <% else -%> <%= item[:quantity] %> <% end -%> </td> <td><%= number_to_currency item[:quantity]*item[:variant].price %></td> <% if page == "cart" -%> <td> <%= link_to "Remove", piggybak.remove_item_url(item[:variant].id), :method => :delete %> </td> <% end -%> </tr> <% end -%> <tr> <td colspan="<%= page == "cart" ? "5" : "4" %>"></td> </tr> <tr> <td colspan="<%= page == "cart" ? "3" : "2" %>"></td> <td>Subtotal</td> <td id="subtotal_total" data-total="<%= @cart.total %>"><%= number_to_currency @cart.total %></td> </tr> <% if page != "cart" -%> <tr> <td colspan="<%= page == "cart" ? "3" : "2" %>"></td> <td>Tax</td> <td id="tax_total"></td> </tr> <tr> <td colspan="<%= page == "cart" ? "3" : "2" %>"></td> <td>Shipping</td> <td id="shipping_total"></td> </tr> <tr> <td colspan="<%= page == "cart" ? "3" : "2" %>"></td> <td>Total</td> <td id="order_total"></td> </tr> <% end -%> </table> <% if page == "cart" %> <%= submit_tag "Update", :id => "update" %> <% end -%> <% end -%> <% else -%> <p id="emtpy"> Your cart is empty. </p> <% end -%>
Version data entries
52 entries across 52 versions & 1 rubygems