Site logo

[Support request] Add WooCommerce cart item indicator to custom icon

Home Forums Support [Support request] Add WooCommerce cart item indicator to custom icon

Home Forums Support Add WooCommerce cart item indicator to custom icon

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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?

    #1909300
    David
    Staff
    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/

    #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 :/

    #1910459
    Leo
    Staff
    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.