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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
  2. {% block component_product_box_action_inner %}
  3.     {% set id = product.id %}
  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 displayFrom and product.childCount <= 0 %}
  8.         {% if displayBuyButton and config('core.listing.allowBuyInListing') and context.customer %}
  9.             {% block component_product_box_action_buy %}
  10.                 {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  11.                 <form action="{{ path('frontend.checkout.line-item.add') }}"
  12.                       method="post"
  13.                       class="buy-widget"
  14.                       data-add-to-cart="true">
  15.                     {% block component_product_box_action_buy_csrf %}
  16.                         {{ sw_csrf('frontend.checkout.line-item.add') }}
  17.                     {% endblock %}
  18.                     {% block component_product_box_action_form %}
  19.                         {% block component_product_box_action_buy_redirect_input %}
  20.                             {# fallback redirect back to detail page is deactivated via js #}
  21.                             <input type="hidden"
  22.                                    name="redirectTo"
  23.                                    value="frontend.detail.page">
  24.                             <input type="hidden"
  25.                                    name="redirectParameters"
  26.                                    data-redirect-parameters="true"
  27.                                    value='{"productId": "{{ product.id }}"}'>
  28.                         {% endblock %}
  29.                         {% block page_product_detail_buy_product_buy_info %}
  30.                             <input type="hidden"
  31.                                    name="lineItems[{{ id }}][id]"
  32.                                    value="{{ id }}">
  33.                             <input type="hidden"
  34.                                    name="lineItems[{{ id }}][referencedId]"
  35.                                    value="{{ id }}">
  36.                             <input type="hidden"
  37.                                    name="lineItems[{{ id }}][type]"
  38.                                    value="product">
  39.                             <input type="hidden"
  40.                                    name="lineItems[{{ id }}][stackable]"
  41.                                    value="1">
  42.                             <input type="hidden"
  43.                                    name="lineItems[{{ id }}][removable]"
  44.                                    value="1">
  45.                             <input type="hidden"
  46.                                    name="lineItems[{{ id }}][quantity]"
  47.                                    value="{{ product.minPurchase }}">
  48.                             <input type="hidden"
  49.                                    name="lineItems[{{ product.id }}][unitPrice]"
  50.                                    value="{{ product.calculatedPrice.unitPrice }}">
  51.                         {% endblock %}
  52.                         {% block page_product_detail_product_buy_meta %}
  53.                             <input type="hidden"
  54.                                    name="product-name"
  55.                                    value="{{ product.translated.name }}">
  56.                         {% endblock %}
  57.                         {% block page_product_detail_product_buy_button %}
  58.                             {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  59.                             {% if feature('v6.5.0.0') %}
  60.                                 <div class="d-grid">
  61.                                     <button class="btn btn-buy"
  62.                                             title="{{ "listing.boxAddProduct"|trans|striptags }}">
  63.                                         {{ "listing.boxAddProduct"|trans|sw_sanitize }}
  64.                                     </button>
  65.                                 </div>
  66.                             {% else %}
  67.                                 <button class="btn btn-block btn-buy"
  68.                                         title="{{ "listing.boxAddProduct"|trans|striptags }}">
  69.                                     {{ "listing.boxAddProduct"|trans|sw_sanitize }}
  70.                                 </button>
  71.                             {% endif %}
  72.                         {% endblock %}
  73.                     {% endblock %}
  74.                 </form>
  75.             {% endblock %}
  76.         {% else %}
  77.             {% block component_product_box_action_detail %}
  78.                 {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  79.                 {% if feature('v6.5.0.0') %}
  80.                     <div class="d-grid">
  81.                         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  82.                            class="btn btn-light"
  83.                            title="{{ "listing.boxProductDetails"|trans|striptags }}">
  84.                             {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  85.                         </a>
  86.                     </div>
  87.                 {% else %}
  88.                     <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  89.                        class="btn btn-block btn-light"
  90.                        title="{{ "listing.boxProductDetails"|trans|striptags }}">
  91.                         {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  92.                     </a>
  93.                 {% endif %}
  94.             {% endblock %}
  95.         {% endif %}
  96.     </div>
  97.     {% block component_product_box_action_meta %}
  98.         <input type="hidden"
  99.                name="product-name"
  100.                value="{{ product.translated.name }}">
  101.         <input type="hidden"
  102.                name="product-id"
  103.                value="{{ id }}">
  104.     {% endblock %}
  105. {% endblock %}