.effective-order = simple_form_for(order, (EffectiveOrders.simple_form_options || {}).merge(url: (order.new_record? ? effective_orders.orders_path : effective_orders.order_path(order)))) do |f| = render partial: 'effective/orders/order_items', locals: {order: order, form: f} - if order.errors[:order_items].present? %p.inline-errors= order.errors[:order_items].first - if order.errors[:total].present? %p.inline-errors= order.errors[:total].first.gsub(EffectiveOrders.minimum_charge.to_i.to_s, price_to_currency(EffectiveOrders.minimum_charge.to_i)) - if EffectiveOrders.collect_user_fields.present? && (f.object.user rescue nil).present? = render partial: 'effective/orders/order_user_fields', locals: {form: f, user: f.object.user } - num_addresses = [EffectiveOrders.require_billing_address, EffectiveOrders.require_shipping_address].count(true) - if num_addresses > 0 .row - if EffectiveOrders.require_billing_address %div{class: "col-sm-#{12 / num_addresses}"} %h3 Billing Address = effective_address_fields(f, :billing_address) - if f.object.user.respond_to?(:billing_address=) = f.input :save_billing_address, as: :boolean, label: 'Save as my default billing address', required: false - if EffectiveOrders.require_shipping_address %div{class: "col-sm-#{12 / num_addresses}"} %h3 Shipping Address = effective_address_fields(f, :shipping_address) - if f.object.user.respond_to?(:shipping_address=) = f.input :save_shipping_address, as: :boolean, label: 'Save as my default shipping address', required: false - if EffectiveOrders.collect_note = render partial: 'effective/orders/order_note_fields', locals: { form: f } - if EffectiveOrders.terms_and_conditions = render partial: 'effective/orders/order_terms_and_conditions_fields', locals: { form: f } %p.text-right - unless f.object.pending? || current_cart.try(:empty?) = link_to_current_cart(label: 'Change Items') - if order.total == 0 && EffectiveOrders.allow_free_orders = f.submit order_checkout_label(:free), class: 'btn btn-primary', rel: :nofollow, data: {'disable_with' => 'Processing...' } - else = f.submit 'Save and Continue', class: 'btn btn-primary', rel: :nofollow, data: {'disable_with' => 'Saving...' }