BACK

how to remove page navigation shopify

Shopify: How to Hide Empty Collections in Navigation hey guys great to be back here on,YouTube don't

Germinate - Shopify Resources

Updated on Mar 05,2023

Shopify: How to Hide Empty Collections in Navigation

The above is a brief introduction to how to remove page navigation shopify

Let's move on to the first section of how to remove page navigation shopify

Let TThunt's experts help you find the best TikTok product on your Shopify business!

Find TikTok products (It's Free)
No difficulty
No complicated process
Find winning products
3.5K Ratings

WHY YOU SHOULD CHOOSE TTHUNT

TThunt has the world's largest selection of TikTok products to choose from, and each product has a large number of advertising materials, so you can choose advertising materials for TikTok ads or Facebook ads without any hassle.

how to remove page navigation shopify catalogs

Shopify: How to Hide Empty Collections in Navigation

hey guys great to be back here on,YouTube don't forget to subscribe to the,channel we put up new videos as often as,we can so yeah please subscribe to the,channel and we'll get you notified when,we get new videos up today we're going,to look at hiding empty navigation I,think this is particularly useful it's,something that I get asked to do a lot,basically when we have a website that,sells out of the products on a,particular navigate it particular,collection or we don't want that,collection show and we don't customers,going and seeing there's no products,available when they click on links in,the navigation basically let's have a,look what that could look like let's,refresh this page I'm at him okay let's,just save this come back to here okay,they should put it back to you okay so,hmm,f5 I just load up okay we've got all of,these in at your screen beans,sample website we've created this,navigation menu that's got all of these,countries of origin now at the moment I,only have one copy top product in here,that's going to match that collection so,all of these collections are let's have,a look at them first of all so all of,these collections are going to be smart,collections if I call the smart,collection and that means so they're,bill using rules so if we go to the,collection here and take a look at any,one of these you can see that they're,created with the rule product tag equals,to product Aggie so I made all these,collections because I know that by the,time we finish this website we're gonna,have plenty of products where the,product tags equal to bright or the,product tags equals who the Peru but all,the Frey in this case the product vendor,is equal to Peru but at the moment we,don't have any products that meet that,criteria so we don't want that menu,showing up right we only want the one,showing up that actually has a SUP the,sample product that matches it okay so,how do we hide those automatically,because doing it manually is a real pain,in the butt and frankly it's never going,to happen and you're gonna have,customers clicking on these things and,it's going to say,sorry there's no products found in this,collection that's what we don't want,okay so let's go back to our online,store going to our theme I'm working on,the turbo theme by out of the sandbox,every theme is going to be a little bit,different but basically they're all,going to have this code in there,somewhere okay so how do we find this,well first of all we know we're working,in the header so let's open up the,header and then there's as you work down,the file you'll see that you're working,down the lines of the header so first of,all there's some stuff for the mobile,and then we're in here we've got like,the social settings head of the phone,number etc so we're right at the top,here I haven't even got it turned on but,we're right on top here and as we come,through we'll see where it talks about a,little shopping cart shopping cart being,over here and eventually we'll get down,to where the navigation is searched who,will find that navigation section it's,going to be somewhere down the bottom,here it's above the search so here we go,so they've really helped me out here in,this particular theme and this might not,be the case in your theme but in this,particular theme you can say they've,said if we're using the vertical menus,which we are the drop-down menus include,this snippet called virtual vertical,menu okay that's great that's really,helped me out because now it would it's,you know much more complicated if they,just drop the code in here in your theme,if you're not using that son box theme,you'll probably find the code is just,dropped here but what you're looking for,is code that looks something like this,and this is basically taking you through,a series of four loops that's going to,build out the menus that exist so let's,have a look at this so basically we want,well this is going to be your main menu,at the top here the first one it's doing,this if Ling lists and the handle this,is for your main menu across the top and,then it's got this sub links section so,these are your sub menus so this these,are the links that cutter in the,up down right full link in linked lists,and your linked lists and Shopify terms,is your navigation lists if the linked,list dot handle is not empty so if the,it's just checking to make sure it's got,a handle I don't know why didn't bothers,to do that but it is and then it says,it's saying basically create this list,item this link in that menu else and,there's something you what else to do if,it doesn't have a handle oh I think what,it's actually doing if it doesn't have a,handle is it's making a pop out for a,third level of menu menu I haven't got,any of those levels and menus in here,but that's what it's doing so okay I,want to put some code in here because I,only wanted to create this link here if,it if it meets certain conditions,now I've already written the code so let,me just paste it in there so basically,what I'm going to tell it to do is an,unless unless loop and I want to just,close the loop off here and explain it,in a minute second to close this and,unless so this is basically a loop it's,saying if the linked list handle is not,empty unless the linked list your,collection link and the object products,count veneer is equal to zero so if the,product counting it is equal to zero,then skip it otherwise do it okay so,let's sell it so basically got the song,list same so basically it will only run,this line if the product account is not,equal to zero if the product can zero,zero it will not run this line ok let's,save this and let's go back to here,refresh this so,what should we have now here we had,about a dozen different by origins we,should now have only one because we've,only got one product we've got four,aromas we've got less of each of the,rest of them but we've only got one in,here okay now I don't have any third,level navigation on this site but if I,want if I had third level navigation I'd,have to do the same thing as I've done,here around this line here because this,is where it's creating the sub sub menus,okay so what it basically do just for,clarity is I'd copy that and I'd wrap,that piece in there as well and then I'd,have to make sure I ended the unless,okay so that should do that it won't,make any difference to my site because I,don't have any third level if that's a,much tidier site for me and it requires,less maintenance okay so don't forget to,subscribe to our Channel and we'll get,you another video out as soon as we can,torture that Bay

Congratulation! You bave finally finished reading how to remove page navigation shopify and believe you bave enougb understending how to remove page navigation shopify

Come on and read the rest of the article!

Browse More Content