1. Add items into cart

enter image description here

  1. Delete browser cache and cookies only [CTRL + SHIFT + DLETE]
  2. Load the page again, it shows no count but cart-count background does not disappear

enter image description here

How to debug what is the root causes of the problem?


as per this line in Magento_Checkout/templates/cart/minicart.phtml (take this from firebug)

<span data-bind="css: { empty: cart().summary_count == 0 }, blockLoader: isLoading" class="counter qty">

empty class added when cart count is zero, but it is never add empty class for the above scenario

If I remove item from minicart window instead of browser, it works and empty class also added.


Debug Magento Mini Cart

If we want to debug the Js Mini Cart, you find the js - minicart.js, for example: pub/static/frontend/Magento/luma/en_US/Magento_Checkout/js/view/minicart.js.

Using Chrome to debug

We can debug with Chrome.

enter image description here

Try with the latest Magento version

I checked with Magento 2.1.1 version, seem they fixed this problem. The new function getCartParam('summary_count') will be used.

data-bind="css: { empty: !!getCartParam('summary_count') == false }, blockLoader: isLoading">

This is css, you are missing a standard part of the magento.css

.minicart-wrapper .action.showcart .counter.qty.empty {
    display: none;
  • no! this is not an answer. I thought, when cart is empty above css automatically get call. we don't need to force anything. I have this problem in staging system only, In development system it works. If you need any further details, please feel free to mention in comment. Oct 5 '16 at 16:41
  • are you saying the empty class is not being added? Oct 5 '16 at 22:30
  • review my updated question Oct 6 '16 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.