Hide menu link in mega menu when product counts = 0

Hide menu link in mega menu when product counts = 0

In header-mega-menu.liquid, search
Warning
{%- for childlink in link.links -%}
Add the following below:
Idea
{%- if childlink.object and childlink.object.products_count == 0 -%}
                      {%- continue -%}
                    {%- endif -%}

Then, search
Warning
 {%- for grandchildlink in childlink.links -%}
Add the following below:
Idea
{%- if grandchildlink.object and grandchildlink.object.products_count == 0 -%}
                              {%- continue -%}
                            {%- endif -%}

    • Related Articles

    • Make parent link clickable

      Snippets > header-mega-menu.liquid (l.19-25) Parentlink {%- assign parentlink = link.links[0] -%} <a href="{{ parentlink.url }}" title="{{ parentlink.title }}"> <span {%- if link.child_active %} class="header__active-menu-item" {% endif %} > {{- ...
    • Make mega menu show only collection that consist of products

      In header-mega-menu.liquid and header-drawer.liquid, add the followings: {%- if childlink.object and childlink.object.products_count == 0 -%} {%- continue -%} {%- endif -%} and {%- if grandchildlink.object and grandchildlink.object.products_count == ...
    • Make Mega Menu Second Child Horizontal

      In the header, add in custom css as below: @media screen and (min-width: 990px) { .header--top-center .mega-menu__list { display: flex; justify-content: left; flex-wrap: wrap; column-gap: 0; } #MegaMenu-Content-1 .mega-menu__list li:nth-child(2) ...
    • Reduce menu link padding in the footer

      In the footer section, add the following in the custom css: .list-menu__item--link { padding: 0px; }
    • Hide products from Google & Shopify Search

      1. Access Your Shopify Admin Log in to your account to enter the backend of your store. Familiarize yourself with the intuitive Shopify admin page and interface, setting the stage for effortless product management. Think of it as your store's control ...