Site logo

Archived topic

Hide Cart in Menu When Empty not working

3 replies · Started by George on October 15, 2020

Viewing posts 1–4 of 4

The code provided here for hiding the cart when empty, doesn't work (even with !important added).

I believe that's because, at least in my case or in the latest GP versions, showing the cart from the Customizer, adds a div with a class of menu-bar-items outside the menu markup. I found that the correct CSS to hide it now is the following:

.mobile-bar-items.wc-mobile-cart-items:not(.has-items),
.main-navigation .wc-menu-item:not(.has-items) {
    display: none;
}

I haven't checked the mobile bar functionality.

Is that a recent change?

Hi George,

yes thats correct - Leo has updated the doc. Thanks for pointing that out.

Thank you, David.

You're welcome

This archived topic is closed to new replies.