Join

Hide Cart When Empty

Don't want to mess with code snippets? Request for this to be a feature of MyListing Pro.

Instructions

  1. Create a new CSS code snippet.
  2. Copy the contents of code snippet below.
  3. Paste the contents into your code snippet.
  4. Review any notes that I’ve provided.
  5. Save and enable the code snippet.
  6. Test.

Snippet

By default, MyListing will show the shopping cart in the navigation area, regardless of whether someone has added anything to their cart.

This snippet helps create a cleaner navigation area with fewer distractions for MyListing websites and applies to those that have enabled the ‘Show Cart’ setting (Theme Tools > Theme Options > Header).

.view-cart-contents:not(:has(.header-cart-counter[data-count])) {
    display: none;
}

Note: Users will see a flash of the cart icon before it disappears. According to the MyListing developers, there is no way around this.