custom/plugins/XioniCmsTwig/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.        
  9.         {% if displayBuyButton and config('core.listing.allowBuyInListing') or product.extensions.xconfig %}
  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.                     {% block component_product_box_action_buy_csrf %}
  17.                         {{ sw_csrf('frontend.checkout.line-item.add') }}
  18.                     {% endblock %}
  19.                     {% block component_product_box_action_form %}
  20.                         {% block component_product_box_action_buy_redirect_input %}
  21.                             {# fallback redirect back to detail page is deactivated via js #}
  22.                             <input type="hidden"
  23.                                    name="redirectTo"
  24.                                    value="frontend.detail.page">
  25.                             <input type="hidden"
  26.                                    name="redirectParameters"
  27.                                    data-redirect-parameters="true"
  28.                                    value='{"productId": "{{ product.id }}"}'>
  29.                         {% endblock %}
  30.                         {% block page_product_detail_buy_product_buy_info %}
  31.                             <input type="hidden"
  32.                                    name="lineItems[{{ id }}][id]"
  33.                                    value="{{ id }}">
  34.                             <input type="hidden"
  35.                                    name="lineItems[{{ id }}][referencedId]"
  36.                                    value="{{ id }}">
  37.                             <input type="hidden"
  38.                                    name="lineItems[{{ id }}][type]"
  39.                                    value="product">
  40.                             <input type="hidden"
  41.                                    name="lineItems[{{ id }}][stackable]"
  42.                                    value="1">
  43.                             <input type="hidden"
  44.                                    name="lineItems[{{ id }}][removable]"
  45.                                    value="1">
  46.                             <input type="hidden"
  47.                                    name="lineItems[{{ id }}][quantity]"
  48.                                    value="{{ product.minPurchase }}">
  49.                             <input type="hidden"
  50.                                    name="lineItems[{{ id }}][matrix_id]"
  51.                                    value="{{ product.extensions.xconfig.matrix_id }}">
  52.                             <input type="hidden"
  53.                                    name="lineItems[{{ id }}][xProductNumber]"
  54.                                    value="{{ product.extensions.xconfig.product_number }}"> 
  55.                             <input type="hidden"
  56.                                    name="lineItems[{{ id }}][xconfig]"
  57.                                    value="1">
  58.                             <input type="hidden"
  59.                                    name="lineItems[{{ id }}][xconfigDesc]"
  60.                                    value="{{ product.extensions.xconfig.description }}">
  61.                             <input type="hidden"
  62.                                    name="lineItems[{{ id }}][xGroupIds]"
  63.                                    value="{{ product.extensions.xconfig.groups }}">
  64.                             <input type="hidden"
  65.                                    name="lineItems[{{ id }}][xGroupValues]"
  66.                                    value="{{ product.extensions.xconfig.values }}">                                    
  67.                         {% endblock %}
  68.                         {% block page_product_detail_product_buy_meta %}
  69.                             <input type="hidden"
  70.                                    name="product-name"
  71.                                    value="{{ product.translated.name }}">
  72.                         {% endblock %}
  73.                         {% block page_product_detail_product_buy_button %}
  74.                             <button class="btn btn-block btn-buy"
  75.                                     title="{{ "listing.boxAddProduct"|trans|striptags }}">
  76.                                 {{ "listing.boxAddProduct"|trans|sw_sanitize }}
  77.                             </button>
  78.                         {% endblock %}
  79.                     {% endblock %}
  80.                 </form>
  81.             {% endblock %}
  82.         {% else %}
  83.             {% block component_product_box_action_detail %}
  84.                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  85.                    class="btn btn-block btn-light"
  86.                    title="{{ "listing.boxProductDetails"|trans|striptags }}">
  87.                     {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  88.                 </a>
  89.             {% endblock %}
  90.         {% endif %}
  91.     </div>
  92.     {% block component_product_box_action_meta %}
  93.         <input type="hidden"
  94.                name="product-name"
  95.                value="{{ product.translated.name }}">
  96.         <input type="hidden"
  97.                name="product-id"
  98.                value="{{ id }}">
  99.     {% endblock %}
  100. {% endblock %}