0

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

2 Answers 2

2
<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>
1
0

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

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.