'Sold out' badge not showing on collection page, Brooklyn theme

Hello,

I have tried everything but the ‘sold out’ page in one of my collections is not showing. There are many products that are out of stock and the sold out shows when you go on the product page but not on collection page. I want to show a badge on collection page so customer does not have to individually click on all products to see which ones are sold out.

URL is daairastudio.com

Thanks!

@Rishamm

Please share theme zip file i will check your theme code and send correct solution to you.

Thanks!

Source: product-grid-item.liquid

{% unless grid_item_width %}
{% assign grid_item_width = ‘large–one-third medium–one-half’ %}
{% endunless %}

{% unless width %}
{%- assign width = 310 -%}
{% endunless %}
{% unless height %}
{%- assign height = 415 -%}
{% endunless %}

{% assign on_sale = false %}
{% if product.compare_at_price > product.price %}
{% assign on_sale = true %}
{% endif %}

{% assign sold_out = true %}
{% if product.available %}
{% assign sold_out = false %}
{% endif %}

{%- assign variant = product.selected_or_first_available_variant -%}

{% if section.settings.product_vendor_enable %}

{{ product.vendor }}

{% endif %}

{% unless grid_image_width %}
{%- assign grid_image_width = ‘600x600’ -%}
{% endunless %}

{%- if product.price_varies == false and variant.unit_price_measurement -%}
{%- capture unit_price_separator -%}
/ {{ ‘general.accessibility.unit_price_separator’ | t }} 
{%- endcapture -%}

{%- capture unit_price_base_unit -%}

{%- if variant.unit_price_measurement.reference_value != 1 -%}
{{- variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ variant.unit_price_measurement.reference_unit }}

{%- endcapture -%}

{{ ‘products.general.unit_price’ | t }}
{{ variant.unit_price | money }}{{- unit_price_separator -}}{{- unit_price_base_unit -}}

{%- endif -%}

{% if section.settings.product_vendor_enable %}

{{ product.vendor }}

{% endif %}