Hide “view cart” button if cart is empty
-
Hello everyone.
When I place a product in the shopping cart (in a standard storefront woocommerce), a new button will appear right next to the “add to cart” button. The new button is labeled “view cart”
Example
Unfortunately this button stays put, even if I delete said item from the cart (in a new tab, via the shopping basket in the nav area, etc.) so that the cart is empty again.
Is there an easy way that I’ve overlooked so far, to get the button to disappear when the cart is empty?
I surely coulddisplay:none;
the whole button all the time, but I only want it gone when there’s no reason to access the cart because it’s empty.I’m unfortunately rather team copy/paste when it comes to php and editing the child’s functions.php or writing plugins and had no luck googling so far.
- The topic ‘Hide “view cart” button if cart is empty’ is closed to new replies.