{% extends "shop/base.html" %}
{% load i18n %}

{% block navbar %}
   <li class="first"><a href="{{ shop_base }}/">{% trans "Home" %}</a></li>
   <li>{% trans "Checkout" %}</li>
{% endblock %}

{% block content %}
<h3>{% trans "Checkout" %}</h3>
<div id="checkoutprogress">
<ul>
    <li class="first"><a href="{% url satchmo_checkout-step1 %}">{% trans "Ship/Bill" %}</a></li>
    <li class="active">{% trans "Payment" %}</li>
    <li>{% trans "Confirmation" %}</li>
</ul>
</div>
<h4>{% trans "Please complete the following information in order to submit your order." %}</h4>

{% if form.errors %}
    <h2>{% blocktrans count form.errors|length as count %}Please correct the following error:{% plural %}Please correct the following errors:{% endblocktrans %}</h2>
    {% if form.non_field_errors %}<p>
    {{ form.non_field_errors }}
    </p>{% endif %}
{% endif %}

<table>
<form method="post" action=".">

    {% block payment_table %}
    {# put your payment module specific rows here.  For example, CC number. #}
    {% endblock %}

    {% if cart.is_shippable %}

        {% if form.shipping_hidden %}
        {{ form.shipping }}
        {% else %}
        <tr><td><h4>{% trans "Shipping Information" %}</h4></td></tr>
        </table>
        {% block shipping_table %}
        <div id="shipping">
        {% if form.shipping_description or form.shipping.field.choices|length_is:1 %}
        <label for="id_shipping">{% trans "The following shipping method will be used" %}:</label>
        {% else %}
        <label for="id_shipping">{% trans "Please choose your preferred shipping method" %}</label>
        {% endif %}
        {{ form.shipping }}
        {% if form.shipping_description %}<br/>{{ form.shipping_description }}{% endif %}
        {% if form.shipping.errors %}*** {{ form.shipping.errors|join:", " }}{% endif %}
        </div>
        {% endblock %}
        {% endif %}
    {% else %}
        <tr><td colspan="2"><h4>{% trans "There are no items in this order to ship." %}</h4></td></tr>
    
    {% endif %}
    </table>

    <input type="submit" value="{% trans "Confirm" %}"/>
</form>

{% endblock %}
