{% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
{% block component_product_box_action_detail %}
<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 %}
{% set FirstVariant = getFirstId(product.id,context.context) %}
{% if FirstVariant.id!='' %}
{% set id = FirstVariant.id %}
{% else %}
{% set id = product.id %}
{% endif %}
{% block component_product_box_action_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": "{{ id }}"}'>
{% endblock %}
{% block page_product_detail_buy_product_buy_info %}
<input type="hidden" name="lineItems[{{ id }}][id]" value="{{ id }}">
<input type="hidden" name="lineItems[{{ id }}][referencedId]" value="{{ id }}">
<input type="hidden" name="lineItems[{{ id }}][type]" value="product">
<input type="hidden" name="lineItems[{{ id }}][stackable]" value="1">
<input type="hidden" name="lineItems[{{ id }}][removable]" value="1">
<input type="hidden" name="lineItems[{{ id }}][quantity]" value="{{ product.minPurchase }}">
{% endblock %}
{% block page_product_detail_product_buy_meta %}
<input type="hidden" name="product-name" value="{{ product.translated.name }}">
{% endblock %}
{% block page_product_detail_product_buy_button %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}" class="btn btn-block btn-light product-link" title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "listing.boxProductDetails"|trans|sw_sanitize }}
</a>
<button class="btn btn-block btn-buy" title="{{ "listing.boxAddProduct"|trans|striptags }}">
<img src="{{ asset('bundles/ldswintercorntheme/assets/menu-bag-white.svg', 'asset') }}" alt="{{ "lwt.listing.productBox.buyTitle"|trans|striptags }}" class="img-fluid cart-icon"/>
</button>
{% endblock %}
{% endblock %}
</form>
{% endblock %}