<?php
echo "<pre>";
print_r($this->helper('Magento\Wishlist\Helper\Data')->getWishlistItemCollection()->addFieldToFilter('product_id', $_product->getId())->count());
die();
?>
I am using this Query to get wish list added product Count but it returns always '0', my current product is already added into wish list !! How to solve this issue?
vendor/magento/module-wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml
Currently, I am testing with 'wishlist.phtml' vendor file
Best Answer
You can try to use this below code :
UPDATE :
Object Manager Method :