{% load basket_tags %}
{% load i18n %}
{% load purchase_info_tags %}
{% purchase_info_for_product request product as session %}
{% if session.availability.is_available_to_buy %}
    {% basket_form request product 'single' as basket_form %}
    <form action="{% url 'basket:add' pk=product.pk %}" method="post">
        {% csrf_token %}
        {{ basket_form.as_p }}
        <button type="submit" class="btn btn-primary btn-block" data-loading-text="{% trans 'Adding...' %}">
            {% trans "Add to basket" %}
        </button>
    </form>
{% else %}
    <span class="btn btn-secondary btn-block disabled">
        {% trans "Add to basket" %}
    </span>
{% endif %}
