A user seeks CSS code to visually indicate sold-out product variants in Shopify’s Studio Theme through two methods: graying out unavailable variant options in dropdown/pill buttons, and reducing opacity of product images when all variants are sold out.
Initial Solution Provided:
BSS-Commerce initially suggested a third-party app (Product & Variants Options), but this didn’t address the specific visual styling request.
Working Code Solution:
BSS-Commerce then provided custom liquid code for main-product.liquid that successfully grays out/strikes through unavailable variants.
The solution involves two code snippets checking variant availability status and applying a “disabled” state.
Multiple users confirmed this code works for Dawn Theme as well, though the exact line placement varies (around line 300 rather than shown in the reference image).
Current Status:
Solution works for single-variant products but has limitations with multi-variant products.
BSS-Commerce acknowledged the multi-variant limitation and committed to developing a fix.
One user reports the code still doesn’t work despite correct placement, suggesting potential theme-specific compatibility issues remain unresolved.
Summarized with AI on November 18.
AI used: claude-sonnet-4-5-20250929.
Is there basic coding to display items that have variants as “grayed out” with sold out variants in the product drop downs/pill buttons so that customers know which items are available?
Also, I’m wanting to have item photos for products that are sold out to automatically be reduced in opacity (but still show as there’s an option to be notified for restocks)
Customizing the variant button with the liquid file is so difficult and prone to conflict, so in your case, I suggest you use a third-party app to solve this problem.
Thank You! I’m not exactly sure this answers the original question though. I’ve included a photo as to what I was hoping to showcase. I don’t see where the app above enables sold out items to grey or cross out?
Thank you!!! This worked for my Dawn theme as well!
The code just needed to be inputted farther down then what your picture displays for me. I just searched the code until I found the exact same coding that was displayed in your pic. Mine was around line 300.
This worked for me in Dawn theme! You just have to search a little bit farther down for the correct place to input the coding. It was around line 300 - just compare to the posted picture above for the exact place you need to input.
We’re happy to see that our suggestion helped you solve the issue. Can you kindly give us a like? This can be a reference for other merchants if they have an issue like you and greatly motivate us.