custom/plugins/WynTheme/src/Resources/views/storefront/component/product/card/wishlist.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/wishlist.html.twig' %}
  2. {% block component_product_wishlist %}
  3.   {% set addToWishlistOptions = {
  4.     productId: productId,
  5.     router: {
  6.       add: {
  7.         afterLoginPath: path('frontend.wishlist.add.after.login', { productId: productId }),
  8.         path: path('frontend.wishlist.product.add', { productId: productId }),
  9.         token: sw_csrf('frontend.wishlist.product.add', {"mode": "token"})
  10.       },
  11.       remove: {
  12.         path: path('frontend.wishlist.product.remove', { productId: productId }),
  13.         token: sw_csrf('frontend.wishlist.product.remove', {"mode": "token"}),
  14.       }
  15.     }
  16.   } %}
  17.   {% set size = size ?? 'md' %}
  18.   <div class="product-wishlist">
  19.     {% block component_product_wishlist_button %}
  20. {#    TODO class="product-wishlist-{{ productId }} btn btn-icon btn-icon--light btn-icon--rounded btn-icon--with-shadow {% if size == 'md' %}btn-icon--small{% endif %} wishlist-button product-wishlist-not-added product-wishlist-loading js-tooltip"#}
  21.       <wyn-button
  22.         variant="secondary"
  23.         icon-button
  24.         {% if size == 'md' %}size="small"{% endif %}
  25.         class="product-wishlist-{{ productId }} wishlist-button product-wishlist-not-added product-wishlist-loading js-tooltip"
  26.         title="{{ "listing.toggleWishlist"|trans|sw_sanitize }}"
  27.         data-add-to-wishlist="true"
  28.         data-add-to-wishlist-options="{{ addToWishlistOptions|json_encode }}"
  29.       >
  30.         {% block component_product_wishlist_icon %}
  31.           {% sw_icon 'heart-fill' style { 'class': 'wishlist icon-wishlist-added', 'size': size, 'slotAttr': 'icon' } %}
  32.           {% sw_icon 'heart' style {'class': 'wishlist icon-wishlist-not-added', 'size': size, 'slotAttr': 'icon' } %}
  33.           {% if showText %}
  34.             <span class="product-wishlist-btn-content text-wishlist-not-added product-wishlist-btn-content-{{ size }}">
  35.               {{ "listing.addToWishlist"|trans|sw_sanitize }}
  36.             </span>
  37.             <span class="product-wishlist-btn-content text-wishlist-remove product-wishlist-btn-content-{{ size }}">
  38.               {{ "listing.removeFromWishlist"|trans|sw_sanitize }}
  39.             </span>
  40.           {% endif %}
  41.         {% endblock %}
  42.       </wyn-button>
  43.     {% endblock %}
  44.   </div>
  45. {% endblock %}