Magento2 Minicart showing blank count
Open your root directory and open minicart.phtml
.
The file path is:
app/design/frontend/{Vendor}/{themename}/Magento_Checkout/templates/cart/minicart.phtml
You have to just replace span with below code,
<span class="counter qty empty"
data-bind="css: { empty: cart().summary_count == 0 }, blockLoader: isLoading">
<!-- ko if: cart().summary_count -->
<span class="counter-number"><!-- ko text: cart().summary_count --><!-- /ko --></span>
<!-- /ko -->
<!-- ko ifnot: cart().summary_count -->
<span class="counter-number">0</span>
<!-- /ko -->
<span class="counter-label">
<!-- ko if: cart().summary_count -->
<!-- ko text: cart().summary_count --><!-- /ko -->
<!-- ko i18n: 'items' --><!-- /ko -->
<!-- /ko -->
</span>
</span>
Run command, php bin/magento setup:static-content:deploy
remove var folder and check again.
Finally i got it by using below code,
<span class="counter-number"><!-- ko text: **cart().summary_count || 0** --><!-- /ko --></span>