custom/plugins/Tuerschild_2/src/Resources/views/storefront/component/product/card/action.html.twig line 1

Open in your IDE?
  1. {% block component_product_box_action_inner %}
  2.     {% set id = product.id %}
  3.     {% if config('core.listing.allowBuyInListing') %}
  4.         <div class="product-action">
  5.             {% set isAvailable = not product.isCloseout or (product.availableStock >= product.minPurchase) %}
  6.             {% set displayFrom = product.calculatedPrices.count > 1 %}
  7.             {% set displayBuyButton = isAvailable and not displayFrom and product.childCount <= 0 %}
  8.                 {% block component_product_box_action_buy %}
  9.                     {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  10.                        <form action="{{ path('frontend.checkout.line-item.add') }}"
  11.                               method="post"
  12.                               class="buy-widget"
  13.                               data-add-to-cart="true">
  14.                             {% block component_product_box_action_buy_csrf %}
  15.                                 {{ sw_csrf('frontend.checkout.line-item.add') }}
  16.                             {% endblock %}
  17.                             {% block component_product_box_action_form %}
  18.                                 {% block component_product_box_action_buy_redirect_input %}
  19.                                     {# fallback redirect back to detail page is deactivated via js #}
  20.                                     <input type="hidden"
  21.                                            name="redirectTo"
  22.                                            value="frontend.detail.page">
  23.                                     <input type="hidden"
  24.                                            name="redirectParameters"
  25.                                            data-redirect-parameters="true"
  26.                                            value='{"productId": "{{ product.id }}"}'>
  27.                                 {% endblock %}
  28.                                 {% block page_product_detail_buy_product_buy_info %}
  29.                                     <input type="hidden"
  30.                                            name="lineItems[{{ id }}][id]"
  31.                                            value="{{ id }}">
  32.                                     <input type="hidden"
  33.                                            name="lineItems[{{ id }}][referencedId]"
  34.                                            value="{{ id }}">
  35.                                     <input type="hidden"
  36.                                            name="lineItems[{{ id }}][type]"
  37.                                            value="product">
  38.                                     <input type="hidden"
  39.                                            name="lineItems[{{ id }}][stackable]"
  40.                                            value="1">
  41.                                     <input type="hidden"
  42.                                            name="lineItems[{{ id }}][removable]"
  43.                                            value="1">
  44.                                     <input type="hidden"
  45.                                            name="lineItems[{{ id }}][quantity]"
  46.                                            value="{{ product.minPurchase }}">
  47.                                 {% endblock %}
  48.                                 {% block page_product_detail_product_buy_meta %}
  49.                                     <input type="hidden"
  50.                                            name="product-name"
  51.                                            value="{{ product.translated.name }}">
  52.                                 {% endblock %}
  53.                                 {% block page_product_detail_product_buy_button %}
  54.                                     <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  55.                                        class="btn btn-block btn-buy"
  56.                                        title="{{ "listing.boxAddProduct"|trans|striptags }}">
  57.                                         {{ "listing.boxAddProduct"|trans|sw_sanitize }}
  58.                                     </a>
  59.                                 {% endblock %}
  60.                             {% endblock %}
  61.                         </form>
  62.                 {% endblock %}
  63.         </div>
  64.     {% endif %}
  65.     {% block component_product_box_action_meta %}
  66.         <input type="hidden"
  67.                name="product-name"
  68.                value="{{ product.translated.name }}">
  69.         <input type="hidden"
  70.                name="product-id"
  71.                value="{{ id }}">
  72.     {% endblock %}
  73. {% endblock %}