Title: Hide cart icon when empty
Last modified: August 12, 2021

---

# Hide cart icon when empty

 *  Resolved [gscottthoms](https://wordpress.org/support/users/gscottthoms/)
 * (@gscottthoms)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/hide-cart-icon-when-empty/)
 * I’ve added a cart icon on my mobile menu bar that links to the cart page. I’ve
   added an html block next to it to show the number of items in the cart as well.
   I wanted to find a way to hide both of them if the number of items in the cart
   is zero. I assume the only way to do that currently would be through CSS, does
   anyone know how this could be done?
 * I used the bottom section of the guide to implement the cart:
    [https://www.megamenu.com/documentation/woocommerce/](https://www.megamenu.com/documentation/woocommerce/)
    -  This topic was modified 4 years, 9 months ago by [gscottthoms](https://wordpress.org/support/users/gscottthoms/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhide-cart-icon-when-empty%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/hide-cart-icon-when-empty/#post-14764372)
 * Hi gscott,
 * As it relates to a pro feature, please can you get in touch through [https://www.megamenu.com/support/](https://www.megamenu.com/support/)?
   Also include a link to this topic. We’ll send some code that adds a class to 
   the body tag when the cart is empty, and use CSS to hide the cart icon when that
   class is present.
 * Regards,
    Tom`

Viewing 1 replies (of 1 total)

The topic ‘Hide cart icon when empty’ is closed to new replies.

 * ![](https://ps.w.org/megamenu/assets/icon-128x128.png?rev=1489843)
 * [Max Mega Menu](https://wordpress.org/plugins/megamenu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/megamenu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/megamenu/)
 * [Active Topics](https://wordpress.org/support/plugin/megamenu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/megamenu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/megamenu/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [megamenu](https://wordpress.org/support/users/megamenu/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/hide-cart-icon-when-empty/#post-14764372)
 * Status: resolved