how to make the sold out variation hide grey and unclickable instead of lines through?

Solved

how to make the sold out variation hide grey and unclickable instead of lines through?

michelle012
Tourist
11 0 4

Does someone know how i can make the sold out variant on the product page grey-fade and unclickable?

Accepted Solution (1)

BSSCommerce-HDL
Shopify Partner
2079 738 929

This is an accepted solution.

Hi @michelle012

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

 

 

 

<style>
.radio__button .sold-out+label:before {
       background: #00000000 !important;
}

span.radio__button:has(.sold-out) label > span {
    color: gray !important;
}

span.radio__button:has(.sold-out) label {
    pointer-events: none;
}
</style>

 

 

Here is result:

BSSCommerceHDL_0-1723475737120.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

 

 

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Replies 4 (4)

BSSCommerce-HDL
Shopify Partner
2079 738 929

This is an accepted solution.

Hi @michelle012

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

 

 

 

<style>
.radio__button .sold-out+label:before {
       background: #00000000 !important;
}

span.radio__button:has(.sold-out) label > span {
    color: gray !important;
}

span.radio__button:has(.sold-out) label {
    pointer-events: none;
}
</style>

 

 

Here is result:

BSSCommerceHDL_0-1723475737120.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

 

 

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

michelle012
Tourist
11 0 4

is there also a solution to make the swatch color grey- fade when sold out?

BSSCommerce-HDL
Shopify Partner
2079 738 929

For swatch you can use this code

<style>
        .swatch__button:has(.sold-out) > label {
           --swatch: #c8c8c8!important;
            pointer-events: none!important;
        }
</style>

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

BSS-TekLabs
Shopify Partner
2080 614 718

- Here is the solution for you @michelle012 
- Please follow these steps:

z5686811214059_e66de1953f1db631f9134af5cdb796ad.jpg

- Then find the base.css or theme.css file.
- Then add the following code at the end of the file and press 'Save' to save it.

.radio__button .sold-out+label:before, .radio__button .unavailable+label:before {
    background: no-repeat !important;
}
.radio__button .sold-out+label {
 background: darkgray !important;
}
.radio__fieldset .radio__button label {
 min-width: 40px !important;
}

- Here is the result you will achieve:

BSSTekLabs_0-1723476056525.png

 

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now