How to check if YITH cart is empty
-
Hi
I’m having trouble with learning how to check if the YITH cart is empty.
Similarly to this code:
// Hide WooCommerce Cart Icon When Empty add_action( 'wp_footer', function() { if ( WC()->cart->is_empty() ) { echo '<style type="text/css">#menu-item-1225{ display: none; }</style>'; } else echo '<style type="text/css">#menu-item-1225{ display: inline-block; }</style>'; });
I would like to check if the YITH cart is empty and according to that, apply certain styles. WooCommerce cart would be checked with
WC()->cart->is_empty()
but this doesn’t seem to apply for YITH. Any suggestions?Many thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to check if YITH cart is empty’ is closed to new replies.