• Resolved handmadehome

    (@handmadehome)


    Hello,

    Can you please, help me hide dollar amount (including currency symbol) from mini cart when cart is empty? I need only cart icon and item count displayed when cart is empty

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there,

    Thanks for reaching out.

    Can you please confirm, would you like to remove the dollar amount from the top header as shown in the following screenshot:

    Please let me know, and I’ll be glad to help further.

    Best,

    Thread Starter handmadehome

    (@handmadehome)

    Exactly!

    Hi there,

    It’s possible to remove the header cart completely when there is no product in the cart. You can add the following PHP snippet in your child theme functions.php file:

    
    add_action( 'wp_head', 'remove_empty_cart_from_menu' );
    function remove_empty_cart_from_menu() {
    	if ( WC()->cart->get_cart_contents_count() == 0 ) {
    		remove_action( 'storefront_header', 'storefront_header_cart', 60 );
    	}
    }
    

    If you only want to remove the amount, and want to keep the cart quantity it requires customization in WC_Widget_Cart. You can reach out to our customization experts for that here:

    https://woocommerce.com/customizations/

    I hope it helps!

    Best,

    Thread Starter handmadehome

    (@handmadehome)

    Thank you!

    Hi there @handmadehome,

    Hope Daniyal’s solution worked on your site! I’ll go ahead and mark this post as resolved now. If you need additional help with the Storefront theme, please start a new thread and we’ll be able to help you out there.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove dollar amount from mini cart when cart is empty’ is closed to new replies.