Skip to content
Addonify

Addonify

Documentation & knowledge based site

  • Docs
    • Quick View
    • Compare Products
    • EDD 2Checkout Inline Gateway
  • Plugins
  • Themes
  • Support
  • Blog
Addonify store
  • Docs
    • Quick View
    • Compare Products
    • EDD 2Checkout Inline Gateway
  • Plugins
  • Themes
  • Support
  • Blog

Getting started [1]

  • Installation

Developer [3]

  • Using Hooks
  • Override Templates
  • Showing Wishlist Count
  • Home
  • Kb
  • WooCommerce Wishlist
  • Developer
  • Showing Wishlist Count

Showing Wishlist Count

  • Updated on: December 16, 2020

Showing total number of wishlist is very easy. Use addonify_wishlist_get_total_items() helper function to display total number of items in current users wishlist. If you also use .addonify-wishlist-count css class than the number will auto update when ever user adds or removes items from “addonify wishlist” plugin.

Example

<p class="addonify-wishlist-count">
  <?php echo addonify_wishlist_get_total_items(); ?>
</p>

Showing Wishlist count in sidebar toggle button

Use following code snippets to show total number of wishlists in sidebar toggle button without modifying the template.

add_filter( 'addonify_wishlist_sidebar_btn_label', 'show_wishlist_count', 10, 2 );
function show_wishlist_count( $btn_label, $total_items ) {
	$btn_label .= ' (<span class="addonify-wishlist-count">' . $total_items . '</span>)';
	return $btn_label;
}

Have fun.

Didn't find what you looking for? Try sending your questions from our contact page.

Your feedback matters to us. Was this article helpful to you?

Copyright © 2021 addonify.com. All rights reserved.

Project by 💖 CreamCode.Org