Question

How do I change this 'add to wish list' button into an icon? I have a png file for this button enter image description here

I did some research online. Some people say by CSS, but not work for me

<style>
.product-social-links .action.towishlist:before {
    background-image: url('/wysiwyg/icons-like-customize-share-sized.png');
}
</style>

enter image description here

No correct solution

OTHER TIPS

<style>
.product-social-links .action.towishlist:before {
    content:'';
    display:inline-block;
    height:   //as per icon size
    width:'';   //as per icon size
    background-image: url('/wysiwyg/icons-like-customize-share-sized.png');
}
</style>

Replace the anchor tag in ,

app/design/frontend/[yourtheme]/Magento_Wishlist/templates/catalog/product/view/addto/wishlist.phtml

<a href="#"
   class="action towishlist notify-wishlist"
   data-post='<?= /* @noEscape */ $block->getWishlistParams() ?>'
   data-action="add-to-wishlist"><span><img src="<?=$block->getViewFileUrl('images/icons-like-customize-share-sized') ?>"/></span></a>

Add the icons-like-customize-share-sized.png in

app/design/frontend/[your theme]/web/images

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top