Sha256: edb660d6ee074dbf4d5aaabf48bc0ed5fc537d61439974358817546734eb6164
Contents?: true
Size: 1.99 KB
Versions: 11
Compression:
Stored size: 1.99 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[:sellable].description %></td> <td><%= number_to_currency item[:sellable].price %></td> <td> <% if page == "cart" -%> <%= text_field_tag "quantity[#{item[:sellable].id}]", item[:quantity] %> <% else -%> <%= item[:quantity] %> <% end -%> </td> <td><%= number_to_currency item[:quantity]*item[:sellable].price %></td> <% if page == "cart" -%> <td> <%= link_to "Remove", piggybak.remove_item_url(item[:sellable].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> <% Piggybak.config.line_item_types.each do |k, v| -%> <% if v.has_key?(:display_in_cart) -%> <tr id="<%= "#{k}_row" %>" style="display:none;"> <td colspan="<%= page == "cart" ? "3" : "2" %>"></td> <td><%= v[:display_in_cart] %></td> <td class="extra_totals" id="<%= k %>_total">$0.00</td> </tr> <% end -%> <% end -%> <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
11 entries across 11 versions & 1 rubygems