Editing collection page text for certain items (Simple theme)

Hi, I want to edit my collection-template.liquid section so on my collections pages, the words “LOW STOCK” in red letters appear next to some of the item titles. Right now the item titles are under the image, which is good, but I don’t know how to modify or add to that text at all. Again, I’m using the Simple theme.

It seems like a quick fix that only involves 2 lines of code - I could be wrong about that- if anyone knows what to do, please help.

1 Like

Hi @Redtooth ,

you can post the code and submit your website link. Let us check and come up with the right solution for you

Thanks you

@Redtooth

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

1 Like

Thanks, the site is charmcitycellphones.com

1 Like

Hi @Redtooth ,

You can follow the instruction below:

  1. Go to Online Store->Theme->Edit code
  2. File collection-template.liquid → find tags h1 (or “collection.title”) → And copy below code right before the tag:

LOW STOCK

when you add the code, it will look like this:

# 
{{ collection.title }}

LOW STOCK

If you feel like my answer is helpful, please mark it as a SOLUTION. Let me know if you have any further questions.

1 Like

@Redtooth

can you please share collection code so i will update

1 Like

A valiant effort, thank you! However, I wasn’t clear enough in my original post.

So I used an editing application to help. This is what I’m looking for:

Sure, get ready for a long copy and paste:

{% paginate collection.products by 12 %}

{% if current_tags.size > 0 %}{{ current_tags.first }}{% else %}{{ collection.title }}{% endif %}

{% if section.settings.collection_sort_enable or section.settings.collection_tag_enable %}

{% if section.settings.collection_tag_enable and collection.all_tags.size > 0 %}
{{ 'collections.general.tags' | t }}
{% endif %} {% if section.settings.collection_sort_enable and collection.products.size > 1 %}
{{ 'collections.sorting.title' | t }} {% assign sort_by = collection.sort_by | default: collection.default_sort_by %}
{% endif %}
{% endif %}

{% if collection.description != blank %}

{{ collection.description }}
{% endif %}

{% for product in collection.products %}
{% if collection.products.size == 1 %}
{% assign grid_item_width = ‘medium-up–one-third small–one-whole’ %}
{% else %}
{% assign grid_item_width = ‘medium-up–one-third small–one-half’ %}
{% endif %}
{% include ‘product-grid-item’ %}
{% else %}
{% comment %}
Add default products to help with onboarding for collections/all only.

The onboarding styles and products are only loaded if the
store has no products.
{% endcomment %}
{% if shop.products_count == 0 and collection.handle == ‘all’ %}
{% unless onboardingLoaded %}
{% comment %}
Only load onboarding styles if they have not already been loaded.
{% endcomment %}
{% assign onboardingLoaded = true %}
{% endunless %}

{% assign collection_index = 1 %} {% for i in (1..6) %} {% assign collection_index = collection_index | plus: 1 %} {% endfor %}
{% else %} {% comment %} If collection exists but is empty, display message {% endcomment %}

{{ 'collections.general.no_matches' | t }}

{% endif %} {% endfor %}

{% if paginate.pages > 1 %}

{{ paginate | default_pagination }}
{% endif %}

{% endpaginate %}

@KetanKumar @AvadaCommerce Do I need to use metafields to implement what I showed in the picture two posts above, maybe? I could be off but that seems the best way to do this. I’ll have to investigate further.

1 Like

@Redtooth

store url

@KetanKumar

Sorry, I posted it above but it’s easy to miss among the rest of the posts. It’s:

www.charmcitycellphones.com/collections/smartphones

Any of the collections could use this change, but let’s focus on smartphones and I’ll copy and paste from there :slightly_smiling_face: Don’t forget my picture from above which shows what I’m looking for, any help is super appreciated!