<% editable = true if local_assigns[:editable].nil? %>
<% if editable %> <% end %> <% cart.cart_items.includes(:product_sku => {:options => :option_set, :product => :category}).each do |cart_item| %> <% end %> <% if TbCommerce.config.sales_tax > 0 %> <% end %> <% if TbCommerce.config.flat_rate_shipping > 0 %> <% end %>
Product Options Quantity Price
<%= link_to cart_item.product_sku.product.title, tb_commerce_category_product_path(cart_item.product_sku.product.category.slug, cart_item.product_sku.product.slug) %> <% cart_item.product_sku.options.each do |option| %> <%= option.label %>: <%= option.value %>
<% end %> <% cart_item.configuration.each do |key, val| %> <% if val.present? %> <%= key %>: <%= val %>
<% end %> <% end %>
<% if editable %> <%= form_for cart_item, :url => tb_commerce_api_cart_item_path(cart_item), :html => {:class => 'form-inline'}, :remote => true, :data => {:success => tb_commerce_cart_path, :errors => :alert} do |f| %> <%= f.number_field :quantity, :class => 'form-control input-sm', :min => 1 %> <%= f.submit 'Update', :class => 'btn btn-sm btn-default' %> <% end %> <% else %> <%= cart_item.quantity %> <% end %> <%= number_to_currency cart_item.total_price %> <% if editable %> <%= link_to 'Remove', tb_commerce_api_cart_item_path(cart_item), :method => :delete, :remote => true, :data => {:success => tb_commerce_cart_path}, :class => 'btn btn-sm btn-danger btn-remove-cart-item' %> <% end %>
Subtotal <%= number_to_currency cart.subtotal %>
Sales Tax <%= number_to_currency cart.sales_tax %> (<%= number_to_percentage(TbCommerce.config.sales_tax*100, :precision => 1) %>)
Shipping <%= number_to_currency cart.shipping_cost %>
Total <%= number_to_currency cart.total_price %>