custom/plugins/IabTheme/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 not displayFrom and product.childCount <= 0 %}
  8.         {% set hidePrice = config('SprinixHidePrice.hidePrice.hidePrices') %}
  9.         {% if displayBuyButton and config('core.listing.allowBuyInListing') %}
  10.             {% block component_product_box_action_buy %}
  11.                 {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  12.                 <form action="{{ path('frontend.checkout.line-item.add') }}"
  13.                       method="post"
  14.                       class="buy-widget"
  15.                       data-add-to-cart="true">
  16.                     {# @deprecated tag:v6.5.0 - Block component_product_box_action_buy_csrf will be removed. #}
  17.                     {% block component_product_box_action_buy_csrf %}
  18.                         {{ sw_csrf('frontend.checkout.line-item.add') }}
  19.                     {% endblock %}
  20.                     {% block component_product_box_action_form %}
  21.                         {{ block('component_product_box_action_buy_redirect_input') }}
  22.                         {{ block('page_product_detail_buy_product_buy_info') }}
  23.                         {{ block('page_product_detail_product_buy_meta') }}
  24.                         {% block page_product_detail_product_buy_button %} {# changed block #}
  25.                             {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  26.                             {% if feature('v6.5.0.0') %}
  27.                                 {{ parent() }}
  28.                             {% else %}
  29.                             <div class="input-group">
  30.                                 {% if context.customer or not(hidePrice) %}
  31.                                     {% if app.request.attributes.get('_route') == 'frontend.wishlist.page' %}
  32.                                         <div class="input-group-append btn-buy-wrapper">
  33.                                             <button class="btn btn-block btn-buy"
  34.                                                     title="{{ "wishlist.addToCart"|trans|striptags }}">
  35.                                                 {{ "wishlist.addToCart"|trans|striptags }}
  36.                                             </button>
  37.                                         </div>
  38.                                     {% elseif app.request.attributes.get('_route') == 'frontend.compare.content' %}
  39.                                         <div class="input-group-append btn-buy-wrapper w-100">
  40.                                             <button class="btn btn-block btn-buy flex-fill"
  41.                                                     title="{{ "compare.addToCart"|trans|striptags }}">
  42.                                                 {{ "compare.addToCart"|trans|striptags }}
  43.                                             </button>
  44.                                         </div>
  45.                                     {% else %}
  46.                                         <input readonly type="text" class="form-control"
  47.                                             value="{{ product.calculatedPrice.unitPrice|currency }}">
  48.                                         <div class="input-group-append">
  49.                                             <button class="btn btn-block btn-buy"
  50.                                                     title="{{ "listing.boxAddProduct"|trans|striptags }}">
  51.                                                 {% sw_icon 'cart' style { namespace: 'IabTheme' } %}
  52.                                             </button>
  53.                                         </div>
  54.                                     {% endif %}
  55.                                 {% else %}
  56.                                     <a href="{{ path('frontend.account.login') }}"
  57.                                             class="btn btn-block btn-buy">
  58.                                         {{ "listing.priceAfterLogin"|trans|sw_sanitize }}
  59.                                     </a>
  60.                                 {% endif %}
  61.                             </div>
  62.                             {% endif %}
  63.                         {% endblock %}
  64.                     {% endblock %}
  65.                 </form>
  66.                 {% if app.request.attributes.get('_route') != 'frontend.compare.content' %}
  67.                     {{ block('component_product_box_action_add_to_compare_button') }}
  68.                 {% endif  %}
  69.             {% endblock %}
  70.         {% else %}
  71.             {{ block('component_product_box_action_detail') }}
  72.         {% endif %}
  73.     </div>
  74.     {{ block('component_product_box_action_meta') }}
  75. {% endblock %}