How to check if current product in the loop is already in the wishlist?
-
I have this code currently:
<? global $product; ?> <div class="yith-wcwl-add-to-wishlist add-to-wishlist-<?php echo esc_attr($product->get_id()); ?> wishlist-fragment on-first-load" style="margin-top: 0;"> <a href="?page&pagename=e-shop&add_to_wishlist=<?php echo esc_attr($product->get_id()); ?>" class='add_to_wishlist single_add_to_wishlist' ref="nofollow" data-product-id="<?php echo get_the_ID(); ?>" data-product-type="simple" title="Προσθ?κη στα αγαπημ?να" > <i class="fa-solid fa-heart fa-lg" style="color: #8c7ead;"></i> </a> </div>
I just want to remove the heart icon if product already exists.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to check if current product in the loop is already in the wishlist?’ is closed to new replies.