{% load i18n currency_filters ocyanjson thumbnail extra_purchase_info_tags %}

{% ocyanjson "oscar" "show_tax_everywhere" False as show_tax %}
<div class="basket-lines">
    <h3>{% trans "Your order" %}</h3>
    {% for line in basket.all_lines %}
        {% block basketline %}
        <div class="basket-line row">
            {% block productimage %}
            <div class="product-image col-4 col-lg-3">
                {% with image=line.product.primary_image %}
                    {% thumbnail image.original "150" upscale=False as thumb %}
                        <a href="{{ line.product.get_absolute_url }}" aria-label="Product image"><img class="thumbnail" src="{{ thumb.url }}" alt="{{ line.product.get_title }}"></a>
                    {% endthumbnail %}
                {% endwith %}
            </div>
            {% endblock %}
            <div class="product-specification col-8 col-lg-9">
                {% block line_description %}
                <div class="item-description col-12">
                    <p><strong><a class="product-link" href="{{ line.product.get_absolute_url }}">{{ line.description }}</a></strong></p>
                </div>
                {% endblock %}
                <div class="total col-12">
                    {% block line_quantity %}
                    <div class="quantity align-center">{% trans "Quantity" %}: {{ line.quantity }}</div>
                    {% endblock %}
                    {% block line_attributes %}
                    {% if line.attributes.all %}
                        <div class="basket-line-options">
                        {% for option in line.attributes.all %}
                            <span class="basket-line-option">{{ option.option }}:{% if option.display_value == True %} {% trans "Yes" %} {% elif option.display_value == False %} {% trans "No" %} {% else %}{{ option.display_value }}{% endif %}</span>
                        {% endfor %}
                        </div>
                    {% endif %}
                    {% endblock %}
                    {% block line_price %}
                    <div class="price_color stock_price">
                        {% total_purchase_info_for_line request line as session %}

                        {% if session.price.from_price %}
                            <span class="from_price">{{session.price.from_price.incl_tax|currency:session.price.currency}}</span>
                        {% endif %}

                        {% include "oscar/catalogue/partials/price.html" %}
                    </div>
                    {% endblock %}
                </div>
            </div>
        </div>
        {% endblock %}
    {% endfor %}
</div>