Show Sold Out products

Solved
jonoboyle
Excursionist
31 2 7

Hi I think I'm being stupid because this must be easy, but I can't find how to still have a product display in my catalogue when it has sold out (but with a Sold Out badge or something).

 

Can anyone point me in the right direction?

 

Thanks

 

I am using Minimal theme and my site is www.yeslove.uk

0 Likes
JonWright
Shopify Partner
729 107 316

This is an accepted solution.

It should do that by default and you are indicating an item is sold out when I select a variant that is out of stock e.g.

 

Screenshot 2020-02-20 at 15.15.56.png

 

If all variants are sold out then you should see a badge that looks like the below when you view it on a collection page.

 

Screenshot 2020-02-20 at 15.20.06.png

If helpful then please Like and Accept Solution
0 Likes
jonoboyle
Excursionist
31 2 7

Got it - I had a rule that inventory needed to be more than 0!

 

Many thanks


@JonWright wrote:

It should do that by default and you are indicating an item is sold out when I select a variant that is out of stock e.g.

 

Screenshot 2020-02-20 at 15.15.56.png

 

If all variants are sold out then you should see a badge that looks like the below when you view it on a collection page.

 

Screenshot 2020-02-20 at 15.20.06.png


 

0 Likes
JonWright
Shopify Partner
729 107 316

Cool, glad you sorted it.

If helpful then please Like and Accept Solution
0 Likes
mischiefmasks
New Member
1 0 0

I'm also having an issue getting Sold Out items to display. I do not have a rule in my collection that limits the display to available products. Is there somewhere else to look?

0 Likes
verybreezy
New Member
3 0 0

I'm also having the same issue. I want my sold out products to still appear on the site (but with an out of stock banner).

0 Likes
rkimpulse
New Member
1 0 1

Hi Everyone, 

I am not great at coding especially liquid coding, but I have found the bit that seems to assign labels to sold out and sale products, and enables you to use the tag prefix _label_ to assign custom labels using tags. 

In my theme, which is Impulse, on the product-grid-item.liquid template in Snippets starting at Line 5 this seems to be the relevant code : 

{%- 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 product_tags = product.tags | join: ',' -%}
{%- assign has_custom_label = false -%}
{% if product_tags contains '_label_' %}
{% for tag in product.tags %}
{% if tag contains '_label_' %}
{%- assign tag_starts_with = tag | slice: 0 -%}
{% if tag_starts_with == '_' %}
{%- assign has_custom_label = true -%}
{%- assign custom_label = tag | replace: '_label_', '' -%}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}

<div class="grid__item grid-product {{ grid_item_width }}{% if settings.quick_shop_enable and sold_out == false %} grid-product__has-quick-shop{% endif %}" data-aos="row-of-{{ per_row }}">
<div class="grid-product__content">
{% if has_custom_label %}
<div class="grid-product__tag grid-product__tag--custom">
{{ custom_label }}
</div>
{% else %}
{% if sold_out %}
<div class="grid-product__tag grid-product__tag--sold-out">
{{ 'products.product.sold_out' | t }}
</div>
{% endif %}
{% if on_sale and sold_out == false %}
<div class="grid-product__tag grid-product__tag--sale">
{{ 'products.general.sale' | t }}
</div>
{% endif %}
{% endif %}

If this code is in place as well as showing Sold Out and Sale labels automatically, you seem to be able to use _label_(insert custom label here) as a tag on individual products and you will be able to show a custom label. E.g. _label_NEW will then show the label NEW on any product you tag with it. 

Have fun I did so much searching to find this solution for myself so I hope it helps... obviously you should BACK UP YOUR THEME BEFORE MAKING CHANGES! 

 

 

trakaismikus
Tourist
7 0 2

OMG! How the f*** I missed this feature in the docs on my Streamline theme, I have no clue.

I was literally about to implement some code changes to just have a "Coming Soon" tag on corner of products instead of "Sold Out". Then I noticed a weird section about these labels and went hmm.. maybe I should google this and this popped up. Just tried and it works flawlessly. Hallelujah!

Turns out the feature is documented on ArcheType theme docs as well: https://archetypethemes.co/blogs/support/can-i-add-custom-new-or-coming-soon-labels-to-my-products?_...

Maybe this reply will help somebody find this information!

0 Likes