Created
February 12, 2021 04:54
-
-
Save shubhw12/7f75be0e68a87ff81d05a7f05d10747b to your computer and use it in GitHub Desktop.
Remove cart icon if empty in new header footer builder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp', 'remove_empty_cart_icon_from_header' ); | |
function remove_empty_cart_icon_from_header( $show ) { | |
if ( null != WC()->cart && 0 == WC()->cart->get_cart_contents_count() ) { | |
remove_action( 'astra_header_woo_cart', array( Astra_Builder_Header::get_instance(), 'header_woo_cart' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment