hello everyone and welcome and this,video will see two things first how to,remove out of stock variants and two how,to link options together let me show you,right away what that means with an end,result here's an example in this case I,have two options so option number one is,for what model I have to model 504 505,and 504 I have only two sizes available,if I change the model to 505,I have only one left because obviously,that one is out of stock for this model,and we can have the same width with a,single option like this example here,normally I have three choices over here,I have 504 505 and five or six but 505,is currently out of stock so I don't,want to show it so here's what my,standard team will look like before,doing the customization so if I select,505 just to have a sold-out notice over,here and I cannot add it to to the cart,but that's not what we want I don't,think it looks nice so let's let's go,ahead and remove it from from the,drop-down we're gonna start with the,with the single product with that the,single option product first and then,we're gonna do the rest please go ahead,and download the file that I have a link,in the description it's gonna link it to,a Google Drive file please download that,I have it over here so first we need to,find this this code this beginning of,the code which generates the drop-down,menus of the,options normally will be in your product,file product template file or the team,but sometimes it may be in another file,like in my case over here so what I will,normally do is go in your in your admin,then online store themes click on the,three dots edit HTML CSS copy it and see,first if you can find it in product that,liquid command F or ctrl F to find to do,a search I don't have it here then look,if it's not in the main layout team that,liquid same thing it's not here what you,will have to do if this is your case,also go back to products and look search,for include I mean caps I don't know if,it's gonna find it no let's do include I,haven't included here social buttons no,that's not what I'm looking for include,product images neither include product,loop may be very sure,here include product form this is where,we want to go and take a look if we,don't find our Shopify option selectors,because um I know that's where you have,the dropdowns for for the options so,let's go ahead and find it over here,will be in your snippets product form,just click on it and if we do again our,search,voila there it is so this is what we,need to find it will look something like,this now pretty simple all you have to,do in order to in order to remove,variants that are out of stock from a,single option product go back to the,code and you have it right here is the,first one just copy you will need to,paste it right after this line finish so,if I go at the end of the line you need,to paste it right after this section so,just I'm gonna click enter paste it over,here let me just make them a little bit,nicer something like that,and as usual it's always a good thing to,comment them in this case because we're,inside of a script JavaScript you need,to comment it with those kind of bars so,let's put the same as here,okay so we're good to go with that just,click Save let's go back over here for,refresh and 505 it's gone so this works,perfectly for single option products but,if we have one with two or more options,the same will not work so in this one,505 I know I only have one in stock if,we go and take a look at it,see five four five I only have the forty,six millimeters that it's available none,of the other ones but it still shows me,the other ones and if I actually if I,click on it unavailable unavailable so,let's go ahead and change that we we,need to go back exactly to the same,place where we were in my case it's,product form in your case maybe product,team or another file but make sure again,you have your in this section of the,code where where it starts with Shopify,option selector so above where we,started where we added the last code,let's just add a new one,which is this one over here so again,let's copy it,don't forget the comment so we know what,what it is I'm gonna use exactly the,same thing sorry okay,so that's good we will save this we now,need to create a new snippet so just,just click on it and we will call it,same as what I have here include linkit,options linked options so just copy this,paste it and for this one you will need,to go ahead in in the comment you're not,going to comment but in the description,of the video and go to the link that I,posted there also you will go to to the,jet hub where you can just copy,everything here and paste it in the new,snippet that we created what I will do,is just click on raw you can do select,all copy go back paste it and save one,last thing we have to do is include this,this file tail we need to tell the the,team to include that file in in all our,our pages so just go in team at the,bottom just before the body close go,back again to the code you need to add,exactly this and actually let's copy,everything and we will add it right here,so now click Save let's go and refresh,this,five four five I have only one and the,beauty of it is if I select five or four,it will show me the two ones available,for 504 as you can see here 504 I have,46 and 48 that are available,I do have 44 but it's out of stock and I,don't want to show it so that's it if,you guys have any questions please don't,forget you can use the comments section,ask me anything I will I will answer,them and I hope I hope it works for you,thank you
Congratulation! You bave finally finished reading how to delete variants options in shopify and believe you bave enougb understending how to delete variants options in shopify
Come on and read the rest of the article!