Home › Forums › Support › Add WooCommerce cart item indicator to custom icon This topic has 3 replies, 3 voices, and was last updated 4 years, 7 months ago by Leo. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts August 25, 2021 at 7:06 am #1907932 Tim I am using a custom icon added to the primary navigation as my shopping cart icon because I needed a custom CSS class on it to open a slideout cart + remove the href. See this thread for details: https://generatepress.com/forums/topic/remove-the-url-from-the-menu-cart-icon I am wondering if there is any way to add WooCommerce’s number-of-items-in-the-cart indicator to my icon? August 26, 2021 at 8:01 am #1909300 DavidStaff Customer Support Hi there, Woo uses this function to get the cart count: <?php WC()->cart->get_cart_contents_count(); ?> More info on that here: https://docs.woocommerce.com/document/show-cart-contents-total/ August 27, 2021 at 12:16 pm #1910413 Tim Every single Google Search result I’ve visited shows how to add this to the stock WooCommerce Cart icon. But I need to add it to my custom icon :/ August 27, 2021 at 1:17 pm #1910459 LeoStaff Customer Support You could try asking in a general forum like this: https://wordpress.stackexchange.com/ Or check with WooCommerce’ support to see if they’ve seen similar requests. Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In