{% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
{% block component_product_box_action_inner %}
{{ parent() }}
{% endblock %}
{#{% block component_product_box_action_inner %}
{% set id = product.id %}
{% if shopware.config.core.listing.allowBuyInListing %}
<div class="product-action">
{% set isVariant = product.parentId is not null %}
{% set isParent = product.childCount > 0 %}
{% set isAvailable = not product.isCloseout or (product.availableStock >= product.minPurchase) %}
{% if isAvailable and not isParent and not isVariant %}
{% 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">
{% 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 %}
<input type="hidden"
name="redirectTo"
value="frontend.cart.offcanvas"/>
{% 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="1">
{% endblock %}
{% block page_product_detail_product_buy_meta %}
<input type="hidden"
name="product-name"
value="{{ product.translated.name }}">
{% endblock %}
{% if page.cmsPage.name == "products_overview" or "home_site" %}
{% block page_product_detail_buy_quantity %}
<select name="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 product.packUnit %} {{ product.packUnit }}{% endif %}
</option>
{% endfor %}
</select>
{% endblock %}
<button class="btn btn-block btn-buy shopping-card-item ">
</button>
{% else %}
<button class="btn btn-block btn-buy"
title="{{ "listing.boxAddProduct"|trans|striptags }}">
{{ "listing.boxAddProduct"|trans|sw_sanitize }}
</button>
{% endif %}
{% endblock %}
</form>
{% endblock %}
{% else %}
{% block component_product_box_action_detail %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="btn btn-block btn-light"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "listing.boxProductDetails"|trans|sw_sanitize }}
</a>
{% endblock %}
{% endif %}
</div>
{% endif %}
{% block component_product_box_action_meta %}
<input type="hidden"
name="product-name"
value="{{ product.translated.name }}">
<input type="hidden"
name="product-id"
value="{{ id }}">
{% endblock %}
{% endblock %}#}