<div class="row">
<div class="col-md-12">
<h2> 购物明细 </h2>
<table class="table table-bordered">
<thead>
<tr>
<th width="80%">商品明细</th>
<th>单价</th>
<th>数量</th>
</tr>
</thead>
<tbody>
<% current_cart.cart_items.each do |cart_item| %>
<tr>
<td>
<%= link_to(cart_item.product.title, product_path(cart_item.product)) %>
</td>
<td>
<%= cart_item.product.price %>
</td>
<td>
<%= cart_item.quantity %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="total clearfix">
<span class="pull-right">
总计 <%= render_cart_total_price(current_cart) %> CNY
</span>
</div>
<hr>
<h2> 订单信息 </h2>
<div class='order-form'>
<%= simple_form_for @order do |f| %>
<legend>购买人</legend>
<div class='form-group col-lg-6'>
<%= f.input :billing_name, placeholder: '请输入购买者姓名', input_html: {value: current_user.name}, :label => '姓名' %>
</div>
<div class='form-group col-lg-6'>
<%= f.input :billing_address, placeholder: '请输入购买者账单地址', input_html: {value: current_user.address}, :label => '地址' %>
</div>
<legend>收货人</legend>
<div class='form-group col-lg-6'>
<%= f.input :shipping_name, placeholder: '请输入收货人姓名', input_html: {value: current_user.name}, :label => '姓名' %>
</div>
<div class='form-group col-lg-6'>
<%= f.input :shipping_address, placeholder: '请输入收货人收件地址', input_html: {value: current_user.address}, :label => '地址' %>
</div>
<div class='checkout'>
<%= f.submit '生成订单', class: 'btn btn-lg btn-danger pull-right', data: { disable_with: 'Submitting...' } %>
</div>
<% end %>
</div>
</div>
</div>