<% content_for :head do %>
  <%= javascript_include_tag :defaults %>
  <%= javascript_include_tag 'cart_delivery' %>
<% end %>

<div class="sectionHeader">発送方法選択</div>

<div id="cart">
  <%- if flash.now[:error] %>
    <div class="errorExplanation" id="errorExplanation">
      <p><%=h flash[:error] %></p>
    </div>
  <% end %>
  <% form_for :order_delivery, :url => {:action => :purchase} do |f| %>
    <% @carts_map.each do |retailer_id, cart_array| %>
      <%= render :partial => "set_delivery_each_retailer", :locals => {:carts => cart_array, :retailer_id => retailer_id, :f => f} %>
    <% end %>
    <%= render :partial => "order_deliveries" %>

    <div class="my_btn4">
      <%=hidden_field_tag "back"%>
      <% if @not_login_customer%>
        <%= submit_tag '戻る', {:onclick => "this.form.action='/cart/temporary_shipping'; this.form.submit();document.getElementById('back').value=1", :class=>'rosy button'} %>
      <% elsif @login_customer%>
        <%= submit_tag '戻る', {:onclick => "this.form.action='/cart/shipping'; this.form.submit();document.getElementById('back').value=1", :class=>'rosy button'} %>
      <% end %>
      <%= submit_tag '次へ', :class=>'rosy button' %>
    </div>


  <% end %>
</div>
