I’m also wondering if this is possible
-
This reply was modified 6 years, 2 months ago by
quit160.
Plugin Author
xootix
(@xootix)
Hi @quit160
Its a paid feature.
Here is the snippet to make it work with the free version, please add this code to your functions.php
add_action( 'wp_footer', function(){
if( WC()->cart->is_empty() ):
?>
<style type="text/css">
.xoo-wsc-basket{
display: none;
}
</style>
<?php
endif; ?>
} );
There were some errors so this is what works for me:
// Woo Sidecart - hide when empty
add_action( 'wp_footer', function() {
if ( WC()->cart->is_empty() ) {
echo '<style type="text/css">.xoo-wsc-basket{ display: none; }</style>';
}
});
The slight usability problem is when you add something to the cart, close the side cart, the basket icon only appears after a refresh or navigating to another page.
-
This reply was modified 6 years, 2 months ago by
ladislavsulc.
Thanks for sharing @xootix!
Your code does show a small error like @ladislavsulc mentions. Is there anyway to fix that code?
@xootix, thank you for your service! I am also trying to hide the basket when empty. It would be great to have this basic option in the free version.
-
This reply was modified 6 years, 1 month ago by
RockSea.
I can’t find the functions.php file in the plugin directory, or do I need to add it to the general functions.php?