vendor/shopware/storefront/Resources/views/storefront/component/product/card/wishlist.html.twig line 1

  1. {% block component_product_wishlist %}
  2.     {% set addToWishlistOptions = {
  3.         productId: productId,
  4.         router: {
  5.             add: {
  6.                 afterLoginPath: path('frontend.wishlist.add.after.login', { productId: productId }),
  7.                 path: path('frontend.wishlist.product.add', { productId: productId }),
  8.             },
  9.             remove: {
  10.                 path: path('frontend.wishlist.product.remove', { productId: productId }),
  11.             }
  12.         }
  13.     } %}
  14.     {% set size = size ?? 'md' %}
  15.     <div class="product-wishlist">
  16.         {% block component_product_wishlist_button %}
  17.             <button
  18.                 class="product-wishlist-{{ productId }} product-wishlist-action{% if appearance == 'circle' %}-circle{% endif %} product-wishlist-not-added product-wishlist-loading"
  19.                 title="{{ "listing.toggleWishlist"|trans|sw_sanitize }}"
  20.                 data-add-to-wishlist="true"
  21.                 data-add-to-wishlist-options="{{ addToWishlistOptions|json_encode }}"
  22.             >
  23.                 {% block component_product_wishlist_icon %}
  24.                     {% sw_icon 'heart-fill' style { 'class': 'wishlist icon-wishlist-added', 'size': size } %}
  25.                     {% sw_icon 'heart' style {'class': 'wishlist icon-wishlist-not-added', 'size': size } %}
  26.                     {% if showText %}
  27.                         <span class="product-wishlist-btn-content text-wishlist-not-added product-wishlist-btn-content-{{ size }}">
  28.                             {{ "listing.addToWishlist"|trans|sw_sanitize }}
  29.                         </span>
  30.                         <span class="product-wishlist-btn-content text-wishlist-remove product-wishlist-btn-content-{{ size }}">
  31.                             {{ "listing.removeFromWishlist"|trans|sw_sanitize }}
  32.                         </span>
  33.                     {% endif %}
  34.                 {% endblock %}
  35.             </button>
  36.         {% endblock %}
  37.     </div>
  38. {% endblock %}