{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
{# ... add floatingBuyboxId to make form-id unique #}
{% block page_product_detail_buy_form_inner %}
{# @var page \Shopware\Storefront\Page\Product\ProductPage #}
{# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
{% set product = page.product %}
<form
id="productDetailPageBuyProductForm{{ floatingBuyboxId }}"
action="{{ block('page_product_detail_buy_form_action') }}"
method="post"
class="buy-widget"
data-add-to-cart="true">
{{ block('page_product_detail_buy_form_inner_csrf') }}
{% set DOWNLOAD_STATE = constant('Shopware\\Core\\Content\\Product\\State::IS_DOWNLOAD') %}
{% set showQuantitySelect = not product.states is defined or DOWNLOAD_STATE not in product.states or (DOWNLOAD_STATE in product.states and product.maxPurchase !== 1) %}
{% set buyable = product.available and product.childCount <= 0 and product.calculatedMaxPurchase > 0 %}
{{ block('page_product_detail_buy_container') }}
</form>
{% endblock %}