{% extends "shop/checkout.html" %}
{% load i18n future mezzanine_tags %}

{% block extra_head %}
{{ block.super }}
<script src="{{ STATIC_URL }}cartridge/js/shipping_fields.js"></script>
{% endblock %}

{% block fields %}
{% if request.cart.has_items %}
{% if not request.user.is_authenticated %}
{% ifinstalled mezzanine.accounts %}
<p>
{% url "login" as login_url %}
{% url "signup" as signup_url %}
{% with request.path as next %}
{% blocktrans %}
If you have an existing account or would like to create one, please
<a href="{{ login_url }}?next={{ next }}">log in</a> or
<a href="{{ signup_url }}?next={{ next }}">sign up</a>.
{% endblocktrans %}
{% endwith %}
</p>
{% endifinstalled %}
{% endif %}

<fieldset>
	<legend>{% trans "Billing Details" %}</legend>
	{% fields_for form.billing_detail_fields %}
</fieldset>

<fieldset>
	<legend>{% trans "Delivery Details" %}</legend>
	{% fields_for form.same_billing_shipping_field %}
	<div id="shipping_fields">{% fields_for form.shipping_detail_fields %}</div>
	{% fields_for form.additional_instructions_field %}
    {% fields_for form.remember_field %}
</fieldset>

{% if not settings.SHOP_CHECKOUT_STEPS_SPLIT and settings.SHOP_PAYMENT_STEP_ENABLED %}
{% include "shop/includes/payment_fields.html" %}
{% endif %}

{% fields_for form.other_fields %}

{% endif %}
{% endblock %}
