On my website I added a hover effect to show a wishlist icon, but when you click the icon, you are transfered to the product page, instead of running the ajax script to add the current product inside the wishlist.
I know that I can easily do this with insertAfter jQuery but before I do I wanted to know if there is a "cleaner" solution in WooCommerce?
I also tried with CSS pointer-events:none but that doesn't have the desired result.
Currently this is the markup:
<a>
<div class"wishlist">My icon</div>
<img>
<h2 class="woocommerce-loop-product__title">
</a>
How can I edit WooComerce with hooks and filters so that I can move the <div class"wishlist">My icon</div> outside of <a> ?
Like:
<div class"wishlist">My icon</div>
<a>
<img>
<h2 class="woocommerce-loop-product__title">
</a>
Right now I use the action woocommerce_before_shop_loop_item to show the wishlist icon.