In header builder, I want to hide cart widget if empty
-
Dear,
How can I hide the cart widget (in the header builder) if the cart is empty ?
Thanks
Hello,
Unfortunately, there is no option and we can hardly suggest a quick fix.
Best Regards
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?
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