Add a label to all products in a collection

Hello,

I would like to add a label to all products in a collection. This particular collection is ‘last chance to buy’ and I would like to label each product so customers can see they will soon be gone. similar to the sold out label that appears automatically. My these is Icon

Any help much appreciated

Hi @selbell83

What theme you are using? Could you share your store URL?

@selbell83

Please follow below steps to add the label for all the products in a specific collection. Let me know whether it is helpful for you.

Steps to add tags to the products quickly of a collection:

  1. From admin, go to products, click “Search and filter” icon collection.

  1. Click “Add filter” and select “Collection” and choose the collection that you want to display label for the products.

  1. Select all the products in the filter and click for more actions.

  1. Click “Add tags”.

  1. Name the tag and save to add tags to all the products of a collection.

Steps to add label to all the products of a collection:

  1. Go to “Online Store” → “Themes”.
  2. Click action button from the current theme and select “Edit code”.
  3. Locate the file “card-product.liquid” and search class named “card__badge”.
  4. Add the below code like as shown in the attached image.
{%- if card_product.tags contains 'last chance to buy' and card_product.available -%}
    last chance to buy
{%- endif -%}

If you are unable to find “card-product.liquid” file, it might be because of the difference in theme. Please share your store URL to check the theme and share you the correct solution.

Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.

Hi Thank you so much! I was able to follow all the steps up until the ‘card-product.liquid’ I dont seem to have this. My theme is icon. I don;'t have the newest version and my url is murrayandme.co.uk

Thanks so much for your help so far!