Adding tabs to your product pages is not difficult--all you have to do is copy and paste a little code here and there. There are two different ways of adding tabs, depending on how you want them to function, so continue reading about the two methods below.
Some store owners want to have tabs that are the same for all products, except for one tab which contains the product description. For example, you might have:
One tab for the product description (which varies for each product)
A second tab for shipping policies (which are the same for all products)
A third tab for return policies (which are the same for all products
In my experience, more store owners prefer to have tabs that are completely unique for each product. For example, on a single product page you might have:
One tab for the product description
One tab for the product's ingredients, or instructions for how to use it, etc.
One tab for a video about the product
In the next few paragraphs I'll walk you through the simple steps for adding these tabs. You can also watch the video walkthrough directly below.
Just in case you mess something up and break your store layout, it's always a good idea to create a backup of your theme before changing the code. You can do this by going to your Shopify Dashboard > Themes, and then clicking "Duplicate" under the theme you are editing.
In order for these tabs to work, your theme will need to have both jQuery and jQuery UI. Most Shopify themes already have jQuery, and many already have jQuery UI, but make sure to check first. You can find out by opening "theme.liquid." This file can be found by going to your Shopify Dashboard, then clicking on Themes > Template Editor. If you have trouble finding this, watch the video tutorial above.
Inside theme.liquid, look for the head tag. It will look like this, but with a bunch of other code in the middle:
The first tag marks the beginning of the head, and the second marks the closing of the head. In between these two tags, look for a line of code that looks something like this:
It will look one of those two lines above, but the numbers (1.4 or 1.9.1) don't have to match exactly. This is the code for jQuery.
Next, look for the jQuery UI code, which looks something like this:
If you find that your theme already has both jQuery and jQuery UI, proceed to step 3. If you see jQuery but not jQuery UI, then copy only the jQuery UI line below. If you don't see either of these already in your theme, then copy and paste both of the following 2 lines of code right before the </head> tag:
Code you'll need to add jQuery and jQuery UI
Regardless of what you did in step 2, you should now add the following code directly before the </head> tag:
Note that you are NOT adding this code to product.liquid, as that would put the same tabs on every single product in your store. Instead, open one of your existing products in your Shopify Dashboard, click the HTML editor button, and then copy and paste this code:
Click "Update" or "Save" to save the changes you made to the product. Then go ahead and view the product on your website to make sure the tabs are showing up properly.
5. Edit the content of each tab to your heart's content After confirming that the tabs are working, continue using the HTML editor to change the tab titles and content.
Note: You may try to edit the tab content in the visual editor (rather than the HTML editor), but this tends to cause problems, since Shopify sometimes adds unwanted code that breaks the tabs. If you do this and your tabs stop working, you'll have to check the HTML editor and delete any unwanted code. You might have to come back here and copy and paste the code again.
I hope that went smoothly for you! If you had any problems, please leave a comment below with a description of the problem and I'll do my best to help.
Comments will be approved before showing up.