How to add a message when there are no products in a collection

Solved
woodpaz_books
Excursionist
16 0 3

Hello everyone,

 

I am trying to add a message that appears on a page when the features collection has no products in it. (I am using the Dawn theme).

 

I appreciate all the help.

Many thanks in advance.

Accepted Solution (1)
laddisahsi
Shopify Partner
321 33 36

This is an accepted solution.

Hi @woodpaz_books 

Please add this code after 345 line number in card-product.liquid

<div class="card-wrapper product-card-wrapper underline-links-hover">
    <div
      class="
        card card--{{ settings.card_style }}
        {% if extend_height %} card--extend-height{% endif %}
        {% if settings.card_style == 'card' %} color-{{ settings.card_color_scheme }} gradient{% endif %}
      "
      style="--ratio-percent: 100%;"
    >
    <h2> NO products yet.</h2>
    
    </div>
  </div>

 

 

If this solution is worked, then please Like this and Mark this as accepted solution!


Laddi

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!

View solution in original post

Replies 6 (6)
laddisahsi
Shopify Partner
321 33 36

This is an accepted solution.

Hi @woodpaz_books 

Please add this code after 345 line number in card-product.liquid

<div class="card-wrapper product-card-wrapper underline-links-hover">
    <div
      class="
        card card--{{ settings.card_style }}
        {% if extend_height %} card--extend-height{% endif %}
        {% if settings.card_style == 'card' %} color-{{ settings.card_color_scheme }} gradient{% endif %}
      "
      style="--ratio-percent: 100%;"
    >
    <h2> NO products yet.</h2>
    
    </div>
  </div>

 

 

If this solution is worked, then please Like this and Mark this as accepted solution!


Laddi

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
woodpaz_books
Excursionist
16 0 3

Hi Ladii,

 

Thank you for the help. This worked.

 

The code makes the message appear 4 times in one row. Can you advise me on how to edit the code so the message appears once?

laddisahsi
Shopify Partner
321 33 36

@woodpaz_books 

Can you please share store URL?

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
woodpaz_books
Excursionist
16 0 3

It's https://b41736-3.myshopify.com/pages/view-all

 

(I only just started building the website).

laddisahsi
Shopify Partner
321 33 36

@woodpaz_books 

Can you please share your template file code?

call the snippet in template right?

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
woodpaz_books
Excursionist
16 0 3

Can you clarify which code you want? The code for the file card-product.liquid?