custom/plugins/FroshProductCompare/src/Resources/views/storefront/component/product/card/compare-button.html.twig line 1

Open in your IDE?
  1. {% block frosh_product_compare_add_to_compare_box %}
  2.     {% set showIconOnly = config('FroshProductCompare.config.showIconOnly') %}
  3.     {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  4.     <div class="compare-button">
  5.         {% set addToCompareOptions = {
  6.             productId: product.id,
  7.             showIconOnly: showIconOnly,
  8.             defaultText: "froshProductCompare.general.addToCompare"|trans|sw_sanitize,
  9.             addedText: "froshProductCompare.general.removeFromCompare"|trans|sw_sanitize
  10.         } %}
  11.         {% block frosh_product_compare_add_to_compare_button %}
  12.             {% if showIconOnly %}
  13.                 <button data-add-to-compare-button="true"
  14.                         data-add-to-compare-button-options="{{ addToCompareOptions|json_encode }}"
  15.                         class="btn btn-block btn-compare"
  16.                         title="{{ "froshProductCompare.general.addToCompare"|trans|striptags }}">
  17.                     {% sw_icon 'bag-product' style { 'size': 'sm', 'color': 'primary' } %}
  18.                 </button>
  19.             {% else %}
  20.                 <button data-add-to-compare-button="true"
  21.                         data-add-to-compare-button-options="{{ addToCompareOptions|json_encode }}"
  22.                         class="btn btn-block btn-compare"
  23.                         title="{{ "froshProductCompare.general.addToCompare"|trans|striptags }}">
  24.                     {{ "froshProductCompare.general.addToCompare"|trans|sw_sanitize }}
  25.                 </button>
  26.             {% endif %}
  27.         {% endblock %}
  28.     </div>
  29. {% endblock %}