custom/plugins/ChiliCustom/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.     {{ parent() }}
  4. {% endblock %}
  5. {#{% block component_product_box_action_inner %}
  6.     {% set id = product.id %}
  7.     {% if shopware.config.core.listing.allowBuyInListing %}
  8.         <div class="product-action">
  9.             {% set isVariant = product.parentId is not null %}
  10.             {% set isParent = product.childCount > 0 %}
  11.             {% set isAvailable = not product.isCloseout or (product.availableStock >= product.minPurchase) %}
  12.             {% if isAvailable and not isParent and not isVariant  %}
  13.                 {% block component_product_box_action_buy %}
  14.                     {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity
  15.                     <form action="{{ path('frontend.checkout.line-item.add') }}"
  16.                           method="post"
  17.                           class="buy-widget"
  18.                           data-add-to-cart="true">
  19.                         {% block component_product_box_action_buy_csrf %}
  20.                             {{ sw_csrf('frontend.checkout.line-item.add') }}
  21.                         {% endblock %}
  22.                         {% block component_product_box_action_form %}
  23.                             {% block component_product_box_action_buy_redirect_input %}
  24.                                 <input type="hidden"
  25.                                        name="redirectTo"
  26.                                        value="frontend.cart.offcanvas"/>
  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="1">
  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.                             {% if page.cmsPage.name == "products_overview" or "home_site" %}
  54.                                 {% block page_product_detail_buy_quantity %}
  55.                                     <select name="lineItems[{{ product.id }}][quantity]"
  56.                                             class="custom-select product-detail-quantity-select">
  57.                                         {% for quantity in range(product.minPurchase, product.calculatedMaxPurchase, product.purchaseSteps) %}
  58.                                             <option value="{{ quantity }}">
  59.                                                 {{ quantity }}{% if product.packUnit %} {{ product.packUnit }}{% endif %}
  60.                                             </option>
  61.                                         {% endfor %}
  62.                                     </select>
  63.                                 {% endblock %}
  64.                                 <button class="btn btn-block btn-buy shopping-card-item ">
  65.                                 </button>
  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.                     </form>
  74.                 {% endblock %}
  75.             {% else %}
  76.                 {% block component_product_box_action_detail %}
  77.                     <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  78.                        class="btn btn-block btn-light"
  79.                        title="{{ "listing.boxProductDetails"|trans|striptags }}">
  80.                         {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  81.                     </a>
  82.                 {% endblock %}
  83.             {% endif %}
  84.         </div>
  85.     {% endif %}
  86.     {% block component_product_box_action_meta %}
  87.         <input type="hidden"
  88.                name="product-name"
  89.                value="{{ product.translated.name }}">
  90.         <input type="hidden"
  91.                name="product-id"
  92.                value="{{ id }}">
  93.     {% endblock %}
  94. {% endblock %}#}