{% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
{% block component_product_box_action_inner %}
{% set id = product.id %}
<div class="product-action">
{% set isAvailable = not product.isCloseout or (product.availableStock >= product.minPurchase) %}
{% set displayFrom = product.calculatedPrices.count > 1 %}
{% set displayBuyButton = isAvailable and not displayFrom and product.childCount <= 0 %}
{% set hidePrice = config('SprinixHidePrice.hidePrice.hidePrices') %}
{% if displayBuyButton and config('core.listing.allowBuyInListing') %}
{% block component_product_box_action_buy %}
{# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
<form action="{{ path('frontend.checkout.line-item.add') }}"
method="post"
class="buy-widget"
data-add-to-cart="true">
{# @deprecated tag:v6.5.0 - Block component_product_box_action_buy_csrf will be removed. #}
{% block component_product_box_action_buy_csrf %}
{{ sw_csrf('frontend.checkout.line-item.add') }}
{% endblock %}
{% block component_product_box_action_form %}
{{ block('component_product_box_action_buy_redirect_input') }}
{{ block('page_product_detail_buy_product_buy_info') }}
{{ block('page_product_detail_product_buy_meta') }}
{% block page_product_detail_product_buy_button %} {# changed block #}
{# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
{% if feature('v6.5.0.0') %}
{{ parent() }}
{% else %}
<div class="input-group">
{% if context.customer or not(hidePrice) %}
{% if app.request.attributes.get('_route') == 'frontend.wishlist.page' %}
<div class="input-group-append btn-buy-wrapper">
<button class="btn btn-block btn-buy"
title="{{ "wishlist.addToCart"|trans|striptags }}">
{{ "wishlist.addToCart"|trans|striptags }}
</button>
</div>
{% elseif app.request.attributes.get('_route') == 'frontend.compare.content' %}
<div class="input-group-append btn-buy-wrapper w-100">
<button class="btn btn-block btn-buy flex-fill"
title="{{ "compare.addToCart"|trans|striptags }}">
{{ "compare.addToCart"|trans|striptags }}
</button>
</div>
{% else %}
<input readonly type="text" class="form-control"
value="{{ product.calculatedPrice.unitPrice|currency }}">
<div class="input-group-append">
<button class="btn btn-block btn-buy"
title="{{ "listing.boxAddProduct"|trans|striptags }}">
{% sw_icon 'cart' style { namespace: 'IabTheme' } %}
</button>
</div>
{% endif %}
{% else %}
<a href="{{ path('frontend.account.login') }}"
class="btn btn-block btn-buy">
{{ "listing.priceAfterLogin"|trans|sw_sanitize }}
</a>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% endblock %}
</form>
{% if app.request.attributes.get('_route') != 'frontend.compare.content' %}
{{ block('component_product_box_action_add_to_compare_button') }}
{% endif %}
{% endblock %}
{% else %}
{{ block('component_product_box_action_detail') }}
{% endif %}
</div>
{{ block('component_product_box_action_meta') }}
{% endblock %}