We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How to remove strikethrough on color swatches?

Solved

How to remove strikethrough on color swatches?

shayansidiqi
Tourist
5 0 5

I sell products with variant colors and sizes.
I don't want the colors to be ever crossed out.

shayansidiqi_0-1750610310854.png

Currently, the default selection is the first option (in this case EU 40) and if the product is out of stock in that size the color swatch also gets crossed even if I have stock available in other sizes. You can see the screenshot attached.

Is there anyway for the color swatches to not get ever crossed.
I'm using theme pipeline.

Thank you

Accepted Solution (1)
Moeed
Shopify Partner
7764 2082 2568

This is an accepted solution.

Hey @shayansidiqi 

 

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>
.swatch__button label:before {
    content: unset !important;
}
</style>

RESULT:

Moeed_0-1750612511612.png

 

If I managed to help then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


View solution in original post

Replies 7 (7)

Moeed
Shopify Partner
7764 2082 2568

Hey @shayansidiqi 

 

Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


shayansidiqi
Tourist
5 0 5

Hello,

Here is the store link: https://ariaboutique.ae/

Thank you

devcoders
Shopify Partner
1654 190 545

Hello @shayansidiqi 

1. From your Shopify Admin, navigate to Online Store > Themes > Edit Code
2. In the Assets folder, open theme.css and add your CSS code at the end

.swatch__button.sold-out a:before, .swatch__button input.sold-out~label:before, .swatch__button input.unavailable~label:before, .swatch__button input:disabled~label:before, .radio__button .sold-out+label:before, .radio__button .unavailable+label:before{
content: none!important;
}

 

devcoders_0-1750611787927.png

 

Shopify Developer: Helping eCommerce Stores
If you need assistance with your store, feel free to contact us at devcodersp@gmail.com
WhatsApp No: +91 8516919310 If my assistance was helpful, please consider liking and accepting the solution. Thank you!
shayansidiqi
Tourist
5 0 5

Hello,

Thank you so much for the answer. This worked and removed the strikethrough, but it also removed the strikethrough on the sizes as well, which is not desirable.

Thank you

Moeed
Shopify Partner
7764 2082 2568

This is an accepted solution.

Hey @shayansidiqi 

 

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>
.swatch__button label:before {
    content: unset !important;
}
</style>

RESULT:

Moeed_0-1750612511612.png

 

If I managed to help then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


Betterave-Nina
Excursionist
67 8 9

Hi @shayansidiqi.

 

Here's how to remove the crossing bar from the color swatches.

 

Here's how to hide the section on mobile.

 

1: Go to Online Store -> Theme -> Edit code
2: Search file theme.css
3: Add the following code to the bottom of the file -> Save

 

.product__block__variants radio-swatch label::before {
	display: none !important;
}

 

If applied correctly, the result should be:

Screenshot_1.png

 

If you don't want to add the code to theme files directly, you can use a code injection app like the one in my signature.

 

I hope this helps!

➡➡   Easy Embed Code   ⬅⬅ insert CSS/JS/HTML/Liquid code into any store page



Speed Booster App - Improve your store speed in 3 clicks
Need professional help with your Shopify store? DM me, let's talk!
Geeky notes

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Those variants are out of stock, so it has a strikethrough. 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.