Variant selection does not cross/grey out

Topic summary

Shop owner using the Retina theme requests a way to visually indicate out-of-stock product variants (sizes and colors) for a hand-knitted dog sweater.

  • Context: Variants are product options (e.g., size, color) that each have their own stock levels. Currently, customers must click through each variant to discover availability, which is hard to identify visually.
  • Desired behavior: Grey out or strike through unavailable options so visitors can quickly see what’s out of stock without trial-and-error clicking.
  • Reference: A product page link is provided to illustrate the issue (redbarkshop.com/.../bravehound-hand-knitted-dog-sweater).
  • Request: Guidance or a method (theme settings or code) to automatically disable/grey out sold-out variants on the product page.
  • Status: No replies or solutions yet; discussion remains open with the key question unanswered.
Summarized with AI on February 4. AI used: gpt-5.

I’m using the Retina theme and run a dog themed shop where there are sizes and colors for a certain sweater.

It’s really hard for a visitor to identify visually what is in stock by clicking on the variants. Is there a way to either grey out or strike out availability when something is out of stock?

I would really appreciate any help on this.

Here’s a link to the page with the issue. If you click through the variants you’ll see

Have you checked your theme settings for this? That’s usually the first place to go when wanting a feature like this. It will usually be in the Product tab or something similar. You paid money for this theme? Check out its settings. It’s there.

@kinddogshop ,

Yes this is possible, but Retina does not handle out-of-stock variants visually by default. You need a small Liquid + CSS tweak.

  1. Enable “Hide sold-out variants” = OFF
    (So customers can still see them)
  2. Add CSS to grey out / strike out sold-out options
.options-selection__option-values .options-selection__option-value:last-child {
  display: none;
}
2 Likes

Yes it’s already set at “Disabled”

Where do I put this code?

Hi @kinddogshop

With Rubik Variant Image & Swatch, you can fully customize your swatches to match your store’s design.

You’re able to:

  • Visually indicate out-of-stock variants

  • Change the color of the out-of-stock line

  • Or completely remove the strike-through if you prefer

Rubik works seamlessly with all major Shopify themes, so it fits naturally into your existing setup.

I’ve also added a short video so you can get a closer look at how the app works.

If you have any questions about setup or customization, our support team will be happy to help you. :blush:

Hey @kinddogshop

Follow these Steps:

  1. Go to Online Store
  2. Edit Code
  3. Find theme.liquid file
  4. Add the following code in the bottom of the file above </ body> tag
<style>
label.options-selection__option-value-label:has(input.options-selection__option-value-input[data-variant-option-available="false"]) {
    opacity: 0.2 !important;
}
</style>

RESULT:

If I managed to help you then a Like would be truly appreciated.

Best,
Moeed

1 Like

No need to edit theme code.
Most CSS codes can go into “Custom CSS” of this section, or even Theme settings=> Custom CSS setting.

label:has([data-variant-option-available="false"]) {
  opacity: 0.25;
}

Result will be like this:

You can also add a cross-line.
However, this CSS is not compatible with “Custom CSS”, so for this you can add a “Custom code” / “Custom liquid” section and use this code:

<style>
label:has([data-variant-option-available="false"]) {
  position: relative;
}

label:has([data-variant-option-available="false"]):after {
  content: "";
  position:absolute;
  inset: 1px;
  background: linear-gradient(-45deg, transparent calc(50% - 1px) , black, transparent calc( 50% + 1px));
}
</style>

The result would be:

And you can combine both to get this result:

That works SO nicely!! THANK YOU!

1 Like