Hello Anjeet,
I presume you mean a counter that updates when you add an new item or remove an item from the wishlist? The videfasions.in website has a textwidget in the header. Currently this can not be done with a widget or shortcode. Only by modifiying the the or a child theme.
In a theme I am using I have this php code to show the counter icon:
<?php
$wishListUrl = '';
if(function_exists('jvm_get_wishlist_url')){
$wishListUrl = jvm_get_wishlist_url();
}
?>
<a href="<?php echo $wishListUrl;?>" class="wish-list-icon">
<img src="<?php echo get_stylesheet_directory_uri();?>/assets/images/heart.gif">
<?php if(function_exists('jvm_woocommerce_wishlist_get_count')) {
$count = jvm_woocommerce_wishlist_get_count();
$class = $count == 0 ? ' hidden' : '';
?>
<span class="count<?php echo $class;?>"><?php echo $count;?></span>
<?php } ?>
</a>
In javascript I have a small piece of code to update the counter:
jQuery(function($) {
$(document).on("beforeupdate.JVMWooCommerceWishlist", function(e) {
// Update some the wishlist counter
var $counter = $('.wish-list-icon .count');
if (e.wishlist.length > 0) {
$counter.removeClass('hidden');
}else {
$counter.addClass('hidden');
}
$counter.html(e.wishlist.length);
});
});
I hope this helps you.
Kind regards, Joris