File tree Expand file tree Collapse file tree
view/frontend/templates/script/component Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ $customerAccountLoginUrl = $block->getUrl('customer/account/login');
2121 this.showCustomerUrls();
2222 this.hideGuestUrls();
2323 this.showGreeting();
24+ this.showWishlistText();
2425 } else {
2526 this.hideCustomerUrls();
2627 this.showGuestUrls();
@@ -64,6 +65,19 @@ $customerAccountLoginUrl = $block->getUrl('customer/account/login');
6465 element.style.display = 'none';
6566 }
6667 },
68+ showWishlistText() {
69+ const element = this.$el.querySelector('.link.wishlist span.counter');
70+ if (!element) {
71+ return;
72+ }
73+
74+ const wishlistSection = Alpine.store('LokiLocalStorage').get('wishlist');
75+ if (!wishlistSection) {
76+ return;
77+ }
78+
79+ element.innerHTML = wishlistSection.counter;
80+ },
6781 getGuestElements() {
6882 return [
6983 this.$el.querySelector('a[href="<?= /* @noEscape */ $ customerAccountLoginUrl ?> "]')
You can’t perform that action at this time.
0 commit comments