Created
September 27, 2022 20:00
-
-
Save macgraphic/69976d6c79ca4e616af235b8c12bcb49 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class to BODY if cart has items | |
function onze_cart_has_items( $classes ) { | |
if ( WC()->cart->get_cart_contents_count() >= 1 ) { | |
$classes[] = 'itemsInCart'; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class','onze_cart_has_items' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment