Support » Plugin: YITH WooCommerce Wishlist » Wishlist count in header

  • Resolved alemones

    (@alemones)


    I would like to pt the wishlist count in my header, like in cart. When I put one product in wishlist, shows one icon with number of items. How can I do this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php $wishlist_count = YITH_WCWL()->count_products();
    echo $wishlist_count; ?>

    But how can update instantly when add on wish list. With this I need to refresh to show

    In case it helps anyone else, i’ve just found this solution for updating the count with ajax, and it’s working for me:

    https://support.yithemes.com/hc/en-us/articles/115001372967-Wishlist-How-to-count-number-of-products-wishlist-in-ajax

    Cheers

    @emj This does not work for the free version. Copying jquery.yith-wcwl.js and renaming it as wishlist.js breaks the page. Skipping that step and adding the snippet on that page to an existing scripts file sort of works, but adding an item to the wishlist creates a weird element that pops up near the wishlist count and fades away. Removing an item from the wishlist does the same thing including causing the wishlist to not respect pagination settings.

    Figured out the weird element that pops up just says “Please wait…” and was squished by my CSS. The only problem that exist and still stands is that adding/removing an item from wishlist will cause wishlist pagination to break and load as if there wasn’t pagination. But perhaps this is not the fault of the total count AJAX.

    • This reply was modified 2 years, 5 months ago by gavsiu.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wishlist count in header’ is closed to new replies.