custom/static-plugins/LdsWintercornTheme/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_detail %}
  3.     
  4.     <form
  5.         action="{{ path('frontend.checkout.line-item.add') }}" method="post" class="buy-widget" data-add-to-cart="true">
  6.         {# @deprecated tag:v6.5.0 - Block component_product_box_action_buy_csrf will be removed. #}
  7.         {% block component_product_box_action_buy_csrf %}
  8.             {{ sw_csrf('frontend.checkout.line-item.add') }}
  9.         {% endblock %}
  10.         {% block component_product_box_action_form %}
  11.             {% set FirstVariant = getFirstId(product.id,context.context) %}
  12.             {% if FirstVariant.id!='' %}
  13.                 {% set id = FirstVariant.id %}
  14.             {% else %}
  15.                 {% set id = product.id %}
  16.             {% endif %}
  17.             {% block component_product_box_action_buy_redirect_input %}
  18.                 {# fallback redirect back to detail page is deactivated via js #}
  19.                 <input type="hidden" name="redirectTo" value="frontend.detail.page">
  20.                 <input type="hidden" name="redirectParameters" data-redirect-parameters="true" value='{"productId": "{{ id }}"}'>
  21.             {% endblock %}
  22.             {% block page_product_detail_buy_product_buy_info %}
  23.                 <input type="hidden" name="lineItems[{{ id }}][id]" value="{{ id }}">
  24.                 <input type="hidden" name="lineItems[{{ id }}][referencedId]" value="{{ id }}">
  25.                 <input type="hidden" name="lineItems[{{ id }}][type]" value="product">
  26.                 <input type="hidden" name="lineItems[{{ id }}][stackable]" value="1">
  27.                 <input type="hidden" name="lineItems[{{ id }}][removable]" value="1">
  28.                 <input type="hidden" name="lineItems[{{ id }}][quantity]" value="{{ product.minPurchase }}">
  29.             {% endblock %}
  30.             {% block page_product_detail_product_buy_meta %}
  31.                 <input type="hidden" name="product-name" value="{{ product.translated.name }}">
  32.             {% endblock %}
  33.             {% block page_product_detail_product_buy_button %}
  34.                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}" class="btn btn-block btn-light product-link" title="{{ "listing.boxProductDetails"|trans|striptags }}">
  35.                     {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  36.                 </a>
  37.                 <button class="btn btn-block btn-buy" title="{{ "listing.boxAddProduct"|trans|striptags }}">
  38.                     <img src="{{ asset('bundles/ldswintercorntheme/assets/menu-bag-white.svg', 'asset') }}" alt="{{ "lwt.listing.productBox.buyTitle"|trans|striptags }}" class="img-fluid cart-icon"/>
  39.                 </button>
  40.             {% endblock %}
  41.         {% endblock %}
  42.     </form>
  43. {% endblock %}