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

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