{% sw_extends '@Storefront/storefront/component/line-item/type/product.html.twig' %}

{% set label = lineItem.label|trans|sw_sanitize %}
{% set label = label !== '' ? label : lineItem.label %}

{% if displayMode is not defined %}
	{% set displayMode = 'default' %}
{% endif %}

{% if showRemoveButton is not defined %}
	{% set showRemoveButton = true %}
{% endif %}

{% set lineItemClasses = 'line-item line-item-' ~ lineItem.type ~ ' is-' ~ displayMode %}

{% if displayMode === 'offcanvas' %}
	{% set lineItemClasses = lineItemClasses ~ ' js-cart-item' %}
{% endif %}

{% if not showRemoveButton %}
	{% set lineItemClasses = lineItemClasses ~ ' no-remove-button' %}
{% endif %}


{% block component_line_item_type_product %}
	{% if controllerName === 'Register' and controllerAction ==='checkoutRegisterPage' %}

		<div class="line-item line-item-product js-cart-item">
			<div class="row line-item-row">

				{% block component_line_item_type_product_col_info %}
					{{ parent() }}
				{% endblock %}

				{% block component_line_item_type_product_col_quantity %}
					{{ parent() }}
				{% endblock %}

				{% if showTaxPrice %}
					{% block component_line_item_type_product_col_tax_price %}
						{{ parent() }}
					{% endblock %}
				{% else %}
					{% block component_line_item_type_product_col_unit_price %}
						{{ parent() }}
					{% endblock %}
				{% endif %}

				{% block component_line_item_type_product_col_total_price %}
					{{ parent() }}
				{% endblock %}

				{% if showRemoveButton %}
					{% block component_line_item_type_product_col_remove %}
						{{ parent() }}
					{% endblock %}
				{% endif %}
			</div>

			{% if displayMode === 'order' %}
				{% block component_line_item_type_product_downloads_table %}
					{{ parent() }}
				{% endblock %}
			{% endif %}
		</div>
	{% else %}
		{{parent()}}
	{% endif %}
{% endblock %}
