{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
{% block page_product_detail_buy_container %}
{% if buyable %}
<div class="form-row buy-widget-container">
{% block page_product_detail_buy_quantity_container %}
<div class="px-0 col product-detail-quantity-select-wrapper d-flex align-items-center">
<label for="lineItems[{{ product.id }}][quantity]" class="product-detail-quantity-select-label">
{{ "detail.quantity"|trans|sw_sanitize }}
</label>
<select name="lineItems[{{ product.id }}][quantity]"
id="lineItems[{{ product.id }}][quantity]"
class="custom-select product-detail-quantity-select">
{% for quantity in range(product.minPurchase, product.calculatedMaxPurchase, product.purchaseSteps) %}
<option value="{{ quantity }}">
{{ quantity }}
{% if quantity == 1 %}
{% if product.translated.packUnit %} {{ product.translated.packUnit }}{% endif %}
{% else %}
{% if product.translated.packUnitPlural %}
{{ product.translated.packUnitPlural }}
{% elseif product.translated.packUnit %}
{{ product.translated.packUnit }}
{% endif %}
{% endif %}
</option>
{% endfor %}
</select>
</div>
{% endblock %}
{% block page_product_detail_buy_redirect_input %}
{# fallback redirect back to detail page is deactivated via js #}
<input type="hidden"
name="redirectTo"
value="frontend.detail.page">
<input type="hidden"
name="redirectParameters"
data-redirect-parameters="true"
value='{"productId": "{{ product.id }}"}'>
{% endblock %}
{% block page_product_detail_buy_product_buy_info %}
<input type="hidden"
name="lineItems[{{ product.id }}][id]"
value="{{ product.id }}">
<input type="hidden"
name="lineItems[{{ product.id }}][type]"
value="product">
<input type="hidden"
name="lineItems[{{ product.id }}][referencedId]"
value="{{ product.id }}">
<input type="hidden"
name="lineItems[{{ product.id }}][stackable]"
value="1">
<input type="hidden"
name="lineItems[{{ product.id }}][removable]"
value="1">
{% endblock %}
{% block page_product_detail_product_buy_meta %}
<input type="hidden"
name="product-name"
value="{{ product.translated.name }}">
<input type="hidden"
name="brand-name"
value="{{ product.manufacturer.getName() }}">
{% endblock %}
{% block page_product_detail_buy_button_container %}
<div class="col px-0">
{% block page_product_detail_buy_button %}
<button class="btn btn-primary btn-buy"
title="{{ "detail.addProduct"|trans|striptags }}"
aria-label="{{ "detail.addProduct"|trans|striptags }}">
{{ "detail.addProduct"|trans|sw_sanitize }}
<span>{% sw_icon 'cart' style {
'namespace': 'Tuerschild_2',
} %} </span>
</button>
{% endblock %}
</div>
{% endblock %}
</div>
{% endif %}
{% endblock %}