<% if Spree::Config[:company] %> <% end %>
<%= name %> <% if use_billing %> <%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.eql?(@order.ship_address)) %> <%= label_tag 'order[use_billing]', t(:use_billing_address) %> <% end %>
<%= f.label :firstname, t(:first_name) + ':' %> <%= f.text_field :firstname %> <%= f.label :lastname, t(:last_name) + ':' %> <%= f.text_field :lastname %>
<%= f.label :company, t(:company) + ':' %> <%= f.text_field :company %>
<%= f.label :address1, t(:street_address) + ':' %> <%= f.text_field :address1, :class => "fullwidth" %> <%= f.label :address2, t(:street_address_2) + ':' %> <%= f.text_field :address2, :class => "fullwidth" %>
<%= f.label :city, t(:city) + ':' %> <%= f.text_field :city %> <%= f.label :zipcode, t(:zip) + ':' %> <%= f.text_field :zipcode, :style => 'width: 100px;' %>
<%= f.label :state_id, t(:state) + ':' %> <%= f.text_field :state_name, :style => "width:150px; display: #{f.object.country.states.empty? ? 'block' : 'none' };", :disabled => !f.object.country.states.empty? %> <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, {:include_blank => true}, {:style => "width:150px; display: #{f.object.country.states.empty? ? 'none' : 'block' };", :disabled => f.object.country.states.empty?} %> <%= f.label :country_id, t(:country) + ':' %> <%= f.collection_select :country_id, available_countries, :id, :name, {}, {:style => 'width: 150px;'} %>
<%= f.label :phone, t(:phone) + ':' %> <%= f.text_field :phone %>
<% content_for :head do %> <%= javascript_tag do -%> $(document).ready(function(){ $('span#<%= name == t(:shipping_address) ? 's' : 'b' %>country select').change(function() { update_state('<%= name == t(:shipping_address) ? 's' : 'b' %>'); }); }); <% end -%> <% end %>