custom/plugins/HyBuys/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.         {% if displayBuyButton and config('core.listing.allowBuyInListing') %}
  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="add_to_cart"
  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.                         {% endblock %}
  49.                         {% block page_product_detail_product_buy_meta %}
  50.                             <input type="hidden"
  51.                                    name="product-name"
  52.                                    value="{{ product.translated.name }}">
  53.                         {% endblock %}
  54.                         {% block page_product_detail_product_buy_button %}
  55.                             {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  56.                             {% if feature('v6.5.0.0') %}
  57. {#                                <div class="d-grid">#}
  58. {#                                    <button class="btn btn-buy"#}
  59. {#                                            title="{{ "listing.boxAddProduct"|trans|striptags }}">#}
  60. {#                                        {{ "listing.boxAddProduct"|trans|sw_sanitize }}#}
  61. {#                                    </button>#}
  62. {#                                    <div class="">#}
  63.                                         <button class="primary_btn" title="{{ "listing.boxAddProduct"|trans|striptags }}" aria-label="add to cart">ADD TO CARD</button>
  64. {#                                    </div>#}
  65. {#                                </div>#}
  66.                             {% else %}
  67. {#                                <div class="add_to_cart">#}
  68.                                     <button class="primary_btn" title="{{ "listing.boxAddProduct"|trans|striptags }}" aria-label="add to cart">ADD TO CARD</button>
  69. {#                                </div>#}
  70.                             {% endif %}
  71.                         {% endblock %}
  72.                     {% endblock %}
  73.                 </form>
  74.             {% endblock %}
  75.         {% else %}
  76.             {% block component_product_box_action_detail %}
  77.                 {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  78.                 {% if feature('v6.5.0.0') %}
  79.                     <div class="d-grid">
  80.                         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  81.                            class="btn btn-light"
  82.                            title="{{ "listing.boxProductDetails"|trans|striptags }}">
  83.                             {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  84.                         </a>
  85.                     </div>
  86.                 {% else %}
  87.                     <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  88.                        class="btn btn-block btn-light"
  89.                        title="{{ "listing.boxProductDetails"|trans|striptags }}">
  90.                         {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  91.                     </a>
  92.                 {% endif %}
  93.             {% endblock %}
  94.         {% endif %}
  95. {#    </div>#}
  96.     {% block component_product_box_action_meta %}
  97.         <input type="hidden"
  98.                name="product-name"
  99.                value="{{ product.translated.name }}">
  100.         <input type="hidden"
  101.                name="product-id"
  102.                value="{{ id }}">
  103.     {% endblock %}
  104. {% endblock %}