{% extends '@Storefront/storefront/component/buy-widget/buy-widget-form.html.twig' %}
{% if pageType == 'product_detail' %}
{% set customizedProductsTemplate = page.product.extensions.swagCustomizedProductsTemplate %}
{% else %}
{% set customizedProductsTemplate = product.extensions.swagCustomizedProductsTemplate %}
{% endif %}
{% block buy_widget_buy_quantity_container %}
<div class="col-12 col-md-2 col-lg-2 {{ theme_config('productDetailBuyboxDisplayAmount') ? '' : 'd-none' }}">
{% block buy_widget_buy_quantity %}
{{ parent() }}
{% endblock %}
</div>
{% endblock %}
{% block buy_widget_buy_container %}
{% if customizedProductsTemplate %}
{% if pageType == 'product_detail' %}
{% if(theme_config('productDetailBuyboxDisplayCustomizedProducts')) %}
{% sw_include '@parent/storefront/component/buy-widget/buy-widget-form-customized-products.html.twig' %}
{% endif %}
{{ parent() }}
{% else %}
<a class="btn btn-primary btn-block"
href="{{ seoUrl('frontend.detail.page', { 'productId': product.id }) }}"
title="{{ 'customizedProducts.stepByStep.navigation.btnConfigureProduct'|trans|striptags }}"
aria-label="{{ 'customizedProducts.stepByStep.navigation.btnConfigureProduct'|trans|striptags }}">
{{ 'customizedProducts.stepByStep.navigation.btnConfigureProduct'|trans|striptags }}
</a>
{% endif %}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block buy_widget_buy_button_container %}
<div class="{% if showQuantitySelect %} col-12 col-md-10 col-lg-10 {% endif %}">
{% block buy_widget_buy_button %}
{# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
{% if feature('v6.5.0.0') %}
<div class="d-grid">
<button class="btn btn-primary btn-buy"
title="{{ "detail.addProduct"|trans|striptags }}"
aria-label="{{ "detail.addProduct"|trans|striptags }}">
{{ "detail.addProduct"|trans|sw_sanitize }}
</button>
</div>
{% else %}
<button class="btn btn-primary btn-block btn-buy"
title="{{ "detail.addProduct"|trans|striptags }}"
aria-label="{{ "detail.addProduct"|trans|striptags }}">
<i class="fa fa-cart-flatbed-boxes "></i>
{{ "detail.addProduct"|trans|sw_sanitize }}
</button>
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% block buy_widget_buy_form_action %}
{% apply spaceless %}
{% if customizedProductsTemplate and customizedProductsTemplate.active and customizedProductsTemplate.options|length %}
{{ path('frontend.checkout.customized-products.add') }}
{% else %}
{{ parent() }}
{% endif %}
{% endapply %}
{% endblock %}
{% block buy_widget_buy_form_inner_csrf %}
{% if customizedProductsTemplate and customizedProductsTemplate.active and customizedProductsTemplate.options|length %}
{{ sw_csrf('frontend.checkout.customized-products.add') }}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}