Hi there. I know this is more of a WooCommerce question than an Enfold question but do you know how to insert a body class like “woocommerce-items-in-cart” if the count of items in the cart is greater than zero. I’ve been tinkering with this and just can’t seem to get it to work.
If not, no worries. If I find a solution on my own, I’ll post it here.
Thanks!
Never mind. I figured it out!
add_filter(‘body_class’, ‘pwm_woocommerce_cart_status’);
function pwm_woocommerce_cart_status( $classes ){
global $woocommerce;
if( $woocommerce->cart->cart_contents_count > 0 ):
$classes[] = ‘woocommerce-items-in-cart’;
endif;
return $classes;
}