Home Forums WoodMart support forum In header builder, I want to hide cart widget if empty

In header builder, I want to hide cart widget if empty

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #292723

    Jeriss Cloud Center
    Participant

    Dear,

    How can I hide the cart widget (in the header builder) if the cart is empty ?

    Thanks

    #292802

    Hello,

    Unfortunately, there is no option and we can hardly suggest a quick fix.

    Best Regards

    #294118

    chaosheld
    Participant

    Hi, instead of opening a new post I try it this way because I try to achieve the same thing and what I’ve found that could lead to the right solution is this:

    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 );
    	}
    }

    Source: https://wordpress.org/support/topic/remove-cart-icon-dollar-amount-and-item-count-when-cart-is-empty/

    My question: Could something like this work for Woodmart too?

    #294200

    Hello,

    Our support does not cover checking the third parties code. Please try to find a developer who would customize for you.

    Unfortunately, we cannot suggest a quick solution.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)