All Products Labelled "Sold Out" But Inventory and Mapping Not Sold Out

Hi everyone. I’ve tried seeking professional help but they are unable to resolve (other than proposing to remove the labels without checking the root). Hence, would like to try out the community here. 2 Issues:

As the title suggests, I need help to debug 2 issues:

[1] My products are all showing as “Sold Out” in public view, but when I’m customizing on Kalles theme, it doesn’t says sold out. I have remapped all my products/ ensure inventory are not 0. But no matter how I’ve tried editing the codes and stuff, the “Sold Out” does not go away. I still want it to show only when all variant of the inventory hits zero. Products on DSers have been checked. Prices have been reset too. Inventory confirm available.

[2] Remove -x% discount label. After i compared product prices and discounted price of my products, there is a -6% label appearing on my product; homepage & individual product page. I’ve managed to hide it using a custom css on the homepage:
(.nt_label.onsale,
.onsale {
display: none !important;
}

However, the discount label is still visible in the individual product page, together with the mysterious “Sold Out” label.

I’m wondering if there’s any professionals here who can guide me on this, please.

For [2], I have the following code:

{%- comment -%}badge_Sale product.created_at product.published_at{%- endcomment-%} {%- liquid if settings.use_new_label assign nowTimestamp = ‘now’ | date: ‘%s’ assign new_day_int = settings.new_day | default: 10 endif assign pr_tags = product.tags | downcase assign prTags = product.tags | join:‘,’ assign hd_up = ‘group-’ |append:product.id assign ck_sale_first = false assign on_sale = false unless pr_tags contains ‘notsale’ if settings.use_sale_label and linklists[hd_up].links.size == 0 and product.compare_at_price > product.price assign ck_sale_first = true assign lb_sale_style = settings.label_sale_style assign pr_variants = product.variants if on == ‘singe’ assign current_variant = product.selected_or_first_available_variant elsif pr_variants.first.compare_at_price > pr_variants.first.price assign current_variant = pr_variants.first else assign current_variant = pr_variants.last endif assign compare_price = current_variant.compare_at_price assign product_price = current_variant.price if compare_price > product_price assign on_sale = true endif endif endunless assign sold_out = true if product.available or settings.use_sold_out_label == false assign sold_out = false endif assign new_label = false unless settings.use_new_label == false or pr_tags contains “notnew” assign dateStart = product.created_at | date: ‘%s’ assign diffSeconds = nowTimestamp | minus: dateStart assign diffDays = diffSeconds | divided_by: 3600 | divided_by: 24 if diffDays <= new_day_int assign new_label = true endif endunless assign badgetags = product.tags | where: "badge" -%} {%- if ck_sale_first -%} {%- if lb_sale_style == ‘1’ -%}<span class=“nt_label onsale”{% if on_sale == false and on == ‘singe’ %} style=“display:none”{% endif %}>{{ ‘products.product.on_sale’ | t }}{%- elsif lb_sale_style == ‘2’ %}{% if on_sale %}{% assign save = compare_price | minus: product_price | times: 100.0 | divided_by: compare_price | ceil %}{% endif %}<span class=“onsale nt_label”{% unless on_sale %} style=“display:none”{% endunless %}>{{ ‘products.product.save_js’ | t: saved_amount:save }}{%- endif -%} {%- endif -%} {%- if new_label -%}{{ ‘products.product.new’ | t }}{%- endif -%} {%- if badge_tags.size > 0 -%} {%- for tag in badgetags limit:3 -%}{%- assign badgeTag = tag | remove: "badge" -%}{%- assign badgeTagHandle = badgeTag | handle -%}{{ badgeTag | capitalize}}{%- endfor -%} {%- endif -%} {%- if sold_out -%}{{ ‘products.product.sold_out’ | t }}{%- endif -%}

However, Claude AI guided me with the following code:

assign sold_out = true

if product.available or settings.use_sold_out_label == false assign sold_out = false

endif

The issue is that your product.available is showing as false (from the debug), so sold_out stays true.

It provided a new code:

assign sold_out = false
if settings.use_sold_out_label and pr_tags contains ‘soldout’
assign sold_out = true
endif

It’s still broken. “Sold Out” is still visible.

Help please. I’m not too sure which is this categorized under too. Thank you.

Hey @xFlakes ,

Welcome to Shopify community. Could you please share the store url and password [if applicable] so that I can take a look and provide you with the solution code.

Thanks

Hello ScriptFlow,

It’s Minitales.shop
password: donkey

Thank you. Hope you’re able to help me.

Thanks for sharing the store url and password with me.

By taking a look in your store I found that I need the access of the store. I found that whether any app is conflicting or it’s a code issue.

Would you mind to share the collab code with me in the p/m or somehow on email that is ins signature below.

Waiting to hearing back from you.

Thanks

Hello @xFlakes ,

Need to debug it.

I suggest proceed with a developer who can check the code for you.

If you need me to fix it please drop an email for services. You can find contact info below in the signature.

Regards
Guleria

Hi Guleria, I’ve got a handful of developers who looked at it and were unable to locate the root of the issue.

Proposed solutions were “hiding” the labels without checking the root which I’m not keen in. Not too interested in quick fix.

I believe it’s an interesting case for developers. Will definitely need a very experience dev to fix it. And I would appreciate if they could view the situation first before discussing about prices/ services (troubleshoot/ debug) because I won’t know if they are able to fix.

Thanks.

Cheers

Hello @xFlakes ,

Thanks for letting me know.

Have your developers checked the issue with other themes like Dawn ?

If yes can you please confirm, Does the same issue exist there or not ?
I’m not asking you to check the ‘sold out’ badge, I’m asking for the product single page atc button.

If the same issue exists with Dawn theme too then it’s really interesting, otherwise the same as others it’s a custom code issue or an app conflict.

Regards
Guleria

Hi @xFlakes Disable any apps when there’s UI/code that you can’t figure out where it’s coming from.

Install a fresh copy of the theme and check if the bug is pre-existing, etc.

Or restore any backup/duplicate themes from BEFORE the issue occurred.

Or try file rollbacks https://help.shopify.com/en/manual/online-store/themes/theme-structure/extend/edit-theme-code#roll-back

If the theme is version controlled revert to an earlier version.

etc etc etc.

If you need the theme actually repaired then contact me for services.
Contact info in forum signature below :down_arrow: :down_arrow: :down_arrow:.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Hi Script, did you receive my email on the collab code?

DSers found the issue. “Shipping”…

THANKS A LOT GUYS :slightly_smiling_face: