Skip to content

Commit 6a972b9

Browse files
committed
Do not display empty minicart
1 parent 04c42e8 commit 6a972b9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

view/frontend/templates/script/components/minicart.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use Magento\Framework\View\Element\Template;
2525

2626
const qty = this.$el.querySelector('span.counter.qty');
2727
if (qty) {
28-
if (this.cart) {
28+
if (this.cart && this.cart.summary_count > 0) {
2929
qty.classList.remove('empty');
3030
} else {
3131
qty.classList.add('empty');
@@ -34,10 +34,10 @@ use Magento\Framework\View\Element\Template;
3434

3535
const counterNumber = this.$el.querySelector('span.counter-number');
3636
if (counterNumber) {
37-
if (this.cart) {
37+
if (this.cart && this.cart.summary_count > 0) {
3838
counterNumber.innerHTML = this.cart.summary_count;
3939
} else {
40-
counterNumber.innerHTML = 0;
40+
counterNumber.innerHTML = '';
4141
}
4242
}
4343
});

0 commit comments

Comments
 (0)