{% load i18n l10n 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 order.lines.all %}
	  {% block basketline %}
		<div class="basket-line row">
			<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>
			<div class="product-specification col-8 col-lg-9">
				<div class="item-description col-12">
					<p><strong><a class="product-link" href="{{ line.product.get_absolute_url }}">{{ line.description }}</a></strong></p>
				</div>
				<div class="total col-12">
					<div class="quantity align-center">{% trans "Quantity" %}: {{ line.quantity }}</div>
					{% 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 %}
					<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 %}
						
						<span class="first-session-price price_color price_incl_tax" data-amount="{{ session.price.incl_tax|unlocalize }}" data-price="{{ session.price.incl_tax|currency:line.order.currency }}">
							{{session.price.incl_tax|currency:line.order.currency}}
						</span>

						{% if show_tax %}
							<span class="second-session-price" data-amount="{{ session.price.excl_tax|unlocalize }}" data-price="{{ session.price.excl_tax|currency:line.order.currency }}">
								{{session.price.excl_tax|currency:line.order.currency}}
							</span>
						{% endif %}
					</div>
					
				</div>
			</div>
		</div>
	  {% endblock %}
	{% endfor %}
</div>