Might i add that i have very little coding experience, and what i do have is limited to hTML and CSS
Hi huzi7868,
I think the best solution for your problem is to overwrite in your theme the add-to-wishlist.php template.
Simply copy wp-content/plugins/yith-woocommerce-wishlist-premium/templates/add-to-wishlist.php and paste it in your theme root; then customize yith-wcwl-wishlistaddedbrowse and yith-wcwl-wishlistexistsbrowse to show the icon
For example, you can use this php snippet
<?php echo $icon ?>
to print icon selected in admin panel for “Add to wishlist button”, as this
<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;">
<a href="<?php echo esc_url( $wishlist_url )?>" >
<?php echo $icon ?>
</a>
</div>
<div class="yith-wcwl-wishlistexistsbrowse <?php echo ( $exists && ! $available_multi_wishlist ) ? 'show' : 'hide' ?>" style="display:<?php echo ( $exists && ! $available_multi_wishlist ) ? 'block' : 'none' ?>">
<a href="<?php echo esc_url( $wishlist_url ) ?>">
<?php echo $icon ?>
</a>
</div>
Now you can customize the previous divs as you wish in your css
Let me know if this helps
Have a nice day 🙂
IS there a way for me to set the icon to be different when already added?
<?php echo $icon ?> and add the actual icon into the code (fore example heart) instead of it loading the add to wishlist icon
Hi again 🙂
Uhm… if you want to use a different icon, maybe it’s better leave $icon variable alone, and use a custom icon template, like this
<i class="fa fa-YOUR_ICON_CLASS"></i>
So, the template could be something like this
<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;">
<a href="<?php echo esc_url( $wishlist_url )?>" >
<i class="fa fa-YOUR_ICON_CLASS"></i>
</a>
</div>
<div class="yith-wcwl-wishlistexistsbrowse <?php echo ( $exists && ! $available_multi_wishlist ) ? 'show' : 'hide' ?>" style="display:<?php echo ( $exists && ! $available_multi_wishlist ) ? 'block' : 'none' ?>">
<a href="<?php echo esc_url( $wishlist_url ) ?>">
<i class="fa fa-YOUR_ICON_CLASS"></i>
</a>
</div>
To check all available font-awesome icon class, check this url
Let me know if this helps
Have a nice day 🙂
That works perfectly. Thank you so very much
Glad to hear that!
Thanks for using our plugin. If you have appreciated our plugin and our help, please don’t forget to give us a 5-star vote! 😉