How to hide unavailable product variants in Shopify?

Please help me to hide the unavailable product variants.

I want to hide Iphone12. Iphone 12 mini, Iphone 12 pro… when choosing SAMSUNG in this case.

Please help me to fix it

P/s Sorry for my bad English.

Hi. You can use this tutorial to hide unavailable variants. Feel free to reach me for any help.

https://help.shopify.com/en/manual/online-store/themes/os/customize/hide-sold-out-variants

Thank you but it’s doesn’t work with my theme. I use District theme

Hi please go in theme.liquid and add that code

Now create a snippet named as ‘linked-options’ and then copy code from here and paste in the snippet.

https://gist.github.com/mujtaba-88/5dbf3c4b5d58ae1764b785d708b6d0b6

Hope its work

Thank you so much, but the link in github is not avalable!

Sorry for that.

Please use this link.

https://github.com/mujtaba-88/Shopify/blob/c0f02860616340e90349c955ed877b7aafbc12da/Remove%20unavailable%20varient

Thank but it still doesn’t work with my theme :disappointed_face: