Hide products in all collection

Hide products in all collection

Add this code in main-collection-product-grid.liquid:

Idea

{% for product in collection.products %}

  {% unless product.metafields.seo.hidden.value == 1 %}

    {% render 'product-card', product: product %}

  {% endunless %}

{% endfor %}


    • Related Articles

    • 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 ...
    • 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 == ...
    • Remove/hide Sold out Badge for out of stock Products

      In base.css file, add this code at the bottom: .grid__item .card-wrapper:has(.price--sold-out) .card--media .card__badge { display: none !important; }
    • Align featured collection titles to center

      In the featured collection section, add the following css in custom css: .collection__title.title-wrapper { text-align-last: center; }
    • Hide menu link in mega menu when product counts = 0

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