custom/plugins/ThemeOkeonline/src/Resources/views/storefront/component/product/card/action.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@parent/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 displayFrom and product.childCount <= 0 %}
  8.         {% set buyIcon = theme_config('productListingStylesProductBoxBuyIcon') %}
  9.         {% set detailIcon = theme_config('productListingStylesProductBoxDetailIcon') %}
  10.         {% set redirect = redirect ? redirect : '' %}
  11.         {% set showBuyButtonText = showBuyButtonText is not null ? showBuyButtonText : true %}
  12.         {% block component_product_box_action_wrapper %}
  13.             {% if displayBuyButton and config('core.listing.allowBuyInListing') %}
  14.                 {% block component_product_box_action_buy %}
  15.                     {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  16.                     {% if redirect == '' %}
  17.                         <form action="{{ path('frontend.checkout.line-item.add') }}"
  18.                             method="post"
  19.                             class="buy-widget"
  20.                             data-add-to-cart="true">
  21.                     {% else %}
  22.                         <form action="{{ path('frontend.checkout.line-item.add') }}"
  23.                             method="post"
  24.                             class="buy-widget"
  25.                             data-form-csrf-handler="true">
  26.                     {% endif %}
  27.                         {% block component_product_box_action_buy_csrf %}
  28.                             {{ parent() }}
  29.                         {% endblock %}
  30.                         {% block component_product_box_action_form %}
  31.                             {% block component_product_box_action_buy_redirect_input %}
  32.                                 {% if redirect == '' %}
  33.                                     {{ parent() }}
  34.                                 {% else %}
  35.                                     <input type="hidden"
  36.                                         name="redirectTo"
  37.                                         value="{{ redirect }}">
  38.                                 {% endif %}
  39.                             {% endblock %}
  40.                             {% block page_product_detail_buy_product_buy_info %}
  41.                                 {{ parent() }}
  42.                             {% endblock %}
  43.                             {% block page_product_detail_product_buy_meta %}
  44.                                 {{ parent() }}
  45.                             {% endblock %}
  46.                             {% block page_product_detail_product_buy_button %}
  47.                                 <button class="btn btn-primary btn-buy"
  48.                                         title="{{ "listing.boxAddProduct"|trans|striptags }}">
  49.                                     {# Create reusable blocks #}
  50.                                     {% if (false) %}
  51.                                         {% block page_product_detail_product_buy_button_icon %}
  52.                                             {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': buyIcon, 'size': 'xl'} %}
  53.                                         {% endblock %}
  54.                                         {% block page_product_detail_product_buy_button_text %}
  55.                                             {% if showBuyButtonText %}
  56.                                                 <span class="boxAddProductText">
  57.                                                     {{ "listing.boxAddProduct"|trans|sw_sanitize }}
  58.                                                 </span>
  59.                                             {% endif %}
  60.                                         {% endblock %}
  61.                                     {% endif %}
  62.                                     {% if
  63.                                         (theme_config('productListingStylesProductBoxButton') == 'icon' and layout != 'image') or
  64.                                         (theme_config('productListingStylesProductBoxImageButton') == 'icon' and layout == 'image')
  65.                                     %}
  66.                                         {{ block('page_product_detail_product_buy_button_icon') }}
  67.                                     {% elseif
  68.                                         (theme_config('productListingStylesProductBoxButton') == 'text' and layout != 'image') or
  69.                                         (theme_config('productListingStylesProductBoxImageButton') == 'text' and layout == 'image')
  70.                                     %}
  71.                                         {{ block('page_product_detail_product_buy_button_text') }}
  72.                                     {% elseif
  73.                                         (theme_config('productListingStylesProductBoxButton') == 'icon-text' and layout != 'image') or
  74.                                         (theme_config('productListingStylesProductBoxImageButton') == 'icon-text' and layout == 'image')
  75.                                     %}
  76.                                         {{ block('page_product_detail_product_buy_button_icon') }}
  77.                                         {{ block('page_product_detail_product_buy_button_text') }}
  78.                                     {% elseif
  79.                                         (theme_config('productListingStylesProductBoxButton') == 'reverse-icon-text' and layout != 'image') or
  80.                                         (theme_config('productListingStylesProductBoxImageButton') == 'reverse-icon-text' and layout == 'image')
  81.                                     %}
  82.                                         {{ block('page_product_detail_product_buy_button_text') }}
  83.                                         {{ block('page_product_detail_product_buy_button_icon') }}
  84.                                     {% endif %}
  85.                                 </button>
  86.                             {% endblock %}
  87.                         {% endblock %}
  88.                     </form>
  89.                 {% endblock %}
  90.             {% else %}
  91.                 {% block component_product_box_action_detail %}
  92.                     <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  93.                     class="btn btn-primary btn-buy"
  94.                     title="{{ "listing.boxProductDetails"|trans|striptags }}">
  95.                         {# Create reusable blocks #}
  96.                         {% if (false) %}
  97.                             {% block component_product_box_action_detail_icon %}
  98.                                 {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': detailIcon, 'size': 'xl'} %}
  99.                             {% endblock %}
  100.                             {% block component_product_box_action_detail_text %}
  101.                                 {% if showBuyButtonText %}
  102.                                     <span class="boxProductDetailsText">
  103.                                         {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  104.                                     </span>
  105.                                 {% endif %}
  106.                             {% endblock %}
  107.                         {% endif %}
  108.                         {% if
  109.                             (theme_config('productListingStylesProductBoxButton') == 'icon' and layout != 'image') or
  110.                             (theme_config('productListingStylesProductBoxImageButton') == 'icon' and layout == 'image')
  111.                         %}
  112.                             {{ block('component_product_box_action_detail_icon') }}
  113.                         {% elseif
  114.                             (theme_config('productListingStylesProductBoxButton') == 'text' and layout != 'image') or
  115.                             (theme_config('productListingStylesProductBoxImageButton') == 'text' and layout == 'image')
  116.                         %}
  117.                             {{ block('component_product_box_action_detail_text') }}
  118.                         {% elseif
  119.                             (theme_config('productListingStylesProductBoxButton') == 'icon-text' and layout != 'image') or
  120.                             (theme_config('productListingStylesProductBoxImageButton') == 'icon-text' and layout == 'image')
  121.                         %}
  122.                             {{ block('component_product_box_action_detail_icon') }}
  123.                             {{ block('component_product_box_action_detail_text') }}
  124.                         {% elseif
  125.                             (theme_config('productListingStylesProductBoxButton') == 'reverse-icon-text' and layout != 'image') or
  126.                             (theme_config('productListingStylesProductBoxImageButton') == 'reverse-icon-text' and layout == 'image')
  127.                         %}
  128.                             {{ block('component_product_box_action_detail_text') }}
  129.                             {{ block('component_product_box_action_detail_icon') }}
  130.                         {% endif %}
  131.                     </a>
  132.                 {% endblock %}
  133.             {% endif %}
  134.         {% endblock %}
  135.     </div>
  136.     {% block component_product_box_action_meta %}
  137.         {{ parent() }}
  138.     {% endblock %}
  139. {% endblock %}