Hello @sarahnoni
Try this:
add_filter('wp_head', 'wpo_menu_cart_custom_a');
function wpo_menu_cart_custom_a()
{
global $woocommerce;
$items = $woocommerce->cart->get_cart();
if( count($items) == 0 || empty($items) ) {
?>
<style>
li.wpmenucartli a.wpmenucart-contents span.cartcontents { display: none !important; }
</style>
<?php
}
}
If you never worked with filters please read our documentation on: How to use filters
-
This reply was modified 5 years, 10 months ago by
alexmigf.
-
This reply was modified 5 years, 10 months ago by
alexmigf.
-
This reply was modified 5 years, 10 months ago by
alexmigf.