How to add a custom product label to WooCommerce

You think

Add custom product tags to your WooCommerce product page ? You are here. In this article, we will show how to display the custom product tab on your online store’s product page .

But before we study in -depth research, let us better understand what the product label is, and why you may want to add a custom product label to your Woocommerce product page. Let’s start with the basic concept of product labels.

What is the product label in WooCommerce?

Product tabs to help organize product pages in one or more options in one or more options through

. Each separate tab contains a set of specific data and is separated from other products. In this way, information becomes easy to access, not so chaotic, visually pleasant and easy to understand.

WooCommerce 中的默认产品标签 Nowadays, most of the products have a lot of basic information that must be conveyed to shoppers. However, to accommodate all information in one place may be tricky. This is why you often see multiple product tabs on the product page, such as brief descriptions, detailed descriptions, technical specifications, comments, etc.

I hope this will give you some understanding of the product label. Now, let’s see some of the reasons you may need to add a custom product tab to the Woocommerce.

Why add custom product labels to Woocommerce?

Above, we have seen that the product tab is a good way to organize product information. However, the default tab does not have enough space to fill in all additional information. What should I do if you want to include detailed instructions, technical specifications, data tables, video tutorials, etc.? You will find that it is difficult to organize all this information using the default tab.

However, you can better organize product details by adding custom product tabs for each group of information. It also allows you to

to freely add all the necessary information

without having to worry about filling the page and overwhelming users. In front of customers, product labels make it easier for shoppers to find information they are interested in and ignore the remaining information. For example, ordinary users may not be interested in detailed technical specifications, but from the productThe description and detailed description are enough. However, people with proficient technology will be more interested in technical specifications and data tables, which makes it easier for them to find the required information.

In addition, as the owner, you can use the custom tab to expose the key company that users must understand policy. For example, you can add a common question tab to answer the most common questions. Similarly, you can add a return policy under a separate tab.

Therefore, it is always recommended to organize your product information to the product tab that is easy to follow. In this way, your users can get what they want in the simplest way without any trouble.

So far, I hope you have understood the importance of custom WOOCOMMERCE product tabs. Now let’s continue the next step to add a custom product tab to Woocommerce.

How to add a custom WOOCOMMERCE product label

We can use

2

Main ways Add custom product tabs to Woocommerce: [123 123 ] Use plug -in

Programming

  1. Let us look at these two methods one by one. We will start with the plug -in method. So let’s sneak in.

1. Use the plug -in to add custom product labels There are multiple WordPress plug -ins for multiple plugins You can add a custom WOOCOMMERCE product tab, so please use any of them at will. However, in order to demonstrate, we will use developed by

Yikes, Inc.

.

The plug -in has free and advanced versions. The free version covers basic requirements. However, if you are interested in more advanced features, you can choose a high -level plan. The starting price is 29.99 US dollars per year, and provides 1 year update and support.

WooCommerce 插件的自定义产品标签 Let’s see how to use the plug -in to add a custom product tab to the Woocommerce. Let’s go!

1.1. Install and activate the plug -in First, you need to be on your websiteInstall and activate the plug -in. To install the plug -in, transfer to your

WP management instrument panel

and navigate to the

plug -in \u0026 gt; add new. Search

yikes, INC

The custom product tab of the Woocommerce plugin . And click to install the button immediately to install the plug -in. After the installation is completed, click to activate to activate the plug -in on your website.

If you want You need to install a plug -in manually. Great! You have now successfully installed the plug -in on your site. It’s time to use the custom product tab of the Woocommerce plugin to add a custom product tab. 1.2. Add the custom product tag to the WooCommerce product

The plug -in activation, you can add the custom product tab from the product editing page to the WooCommerce product. From your 为 WooCommerce 插件安装自定义产品选项卡 WP management instrument board,

to

product \u0026 gt; all products.

Now, hang the mouse to the product you want to add a custom tab, and then click

to edit.

This will open the product editing page. Roll down to the product data part, and then click the custom tab. You will get two options, Add tab and add a saved tab (will be introduced in detail later). Click the \”

add tab

\” button, it will open the \”New Customized Tab\” form. 在 WooCommerce 中编辑产品

In the New Tab form, specify the TAB title and add it related information. Add text, images, links, multimedia, etc. at will. In addition, you can add multiple custom tabs by clicking the \” adding tab \” button at the bottom. If you have multiple custom tabs, you can change their order through the order of the mobile tab. After completion, click Save tab to save the newly created custom tab.

将自定义选项卡添加到 WooCommerce 产品 Look! It’s that simple. You have created yourself nowCustom product tab. Now, navigate to the front of your product page to view the custom tags on your website.

However, adding the custom tab to multiple products may be exhausted, and it is not an effective method. This is why the plug -in has the function of \”saved labels\”.

Let’s take a look at the saved labels and see how we add them to the WooCommerce product.

自定义 WooCommerce 产品选项卡的详细信息

技术规格产品标签

1.3. Create a preserved tab

The preserved The tab

as a template, you can save it for future use. After creating a preserved tab, you can add it to the product with only a few simple steps. Therefore, the saved label can quickly and easily add a custom tag to multiple products.

To create a saved tab, please go to your WP administrator instrument panel and click Custom product tab . Here, you will see the list of all the saved tabs you have created before. Now, click the \” add tab

\” button on the top, which will take you into the \”New Tab\” form.

In the \”New tab\” form, specify the tab title and add a name for your reference. Next, add the tab content. This may include text, images, multimedia, links, etc. Once you are satisfied with all changes, click the \”

saving tab

\” button to save the tab. Like this, you can add any number of tabs for future use. To find all the saved tabs you created, just turn to WP management instrument board \u0026 gt; custom product tab.

Here, you will find all saved tabs, you can edit, delete or add a new tab from here.

添加已保存的自定义产品选项卡

创建自定义产品选项卡模板

After creating its own \”saved label\”, only You need to click a few times to add them to any product. Let’s see how to do this. 1.4. Add the saved tags to the Woocommerce product

Add the saved tags to the process of product compliance and adding conventional tags. Go to the product editing page and roll down to the product data departmentpoint. Click the custom tab, and then click to add the saved tab button .

查看所有已保存的自定义产品选项卡 Select the tab to be added from the \”Save tab\” list. It will load the data of all selected tabs. You can now save or modify it according to your requirements. You can add more custom tabs by clicking the corresponding buttons and re -arrange the tab according to your preference.

Finally, there is a checkbox that can cover the preserved tab. Basically, it disconnects the tab with the original \”saved tab\”. Therefore, in the future, if you make any changes to the saved tabs, they will not be reflected in the product.

将保存的产品选项卡添加到 WooCommerce 产品 After saving the custom product tab, it will immediately immediately immediately immediately immediately immediately immediately immediately immediately, it will immediately immediately immediately immediately immediately immediately immediately, it will immediately immediately immediately immediately immediately immediately immediately. Appears on the product page. To verify, just navigate to the front end of your website and transfer to the product page and view your custom tab.

We have seen how to use a third -party plug -in to add a custom product tab to WooCommerce. However, there is another method that can achieve the same function, even with custom code fragment. Let’s see how to add the custom product tab to the WooCommerce product page by programming.

2. Add the custom product tab by programming Before we jump into the code fragment to add a custom product tab to the WoOOCOMMERCE, let’s see how to take the code fragment first Add to Woocommerce. 2.1. Visit the code editor of WordPress

First of all, we strongly recommend that you create a complete backup of the site and edit the sub -theme to edit

Functions.php 修改产品选项卡详细信息 file. If you don’t know, please check our guideline on how to create a sub -theme. Or, if you don’t want to manually operate, please check these sub -theme plugins.

产品页面上显示的常见问题选项卡

After completing the theme To

appearance \u0026 gt; theme editor.

Make sure to choose the theme of the sub -theme and open

Functions.php

. Now you can be fuuNCTIONS.PHP File adds your custom code fragment at the end. After completion, click

to update the file button

to make the change take effect. Or, you can use code fragment

plug -in to add custom code fragments to your site. First, you need to install a plug -in from the WordPress storage repository. Just turn to

WP management instrument board \u0026 gt; plug -in \u0026 gt; add new. Search code fragment plug -in and install it on your website. Then, from your wp admin Custom code segment. Just like this, you can add any number of custom code fragments as needed.

编辑 functions.php 文件

A cool thing to use this plugin is You don’t need to create any sub -theme, because the plug -in will process the code clip by yourself. However, if there is a problem, it is still recommended to use sub -themes to protect your website. Now you have already understood how to add code fragments to the WordPress website, let us see how we use custom code fragments to add a custom product tab to Woocommerce.

2.2. Add the custom product tags to all products in WooCommerce

代码片段插件 once at a time to add a custom product tab to all products, because the information of all products remains unchanged. For example, you can add common questions to all products or at least in all products or at least in the specified product category.

The following code fragment can be used to add a global custom product tab and fill it with related content. //添加一个新的自定义产品选项卡add_filter(\u0026#39;woocommerce_product_tabs\u0026#39;, \u0026#39;ql_new_custom_product_tab\u0026#39;);功能ql_new_custom_product_tab( $tabs ) {// To add multiple tabs, please update $ tabs [\u0026#39; xyz \u0026#39;] label in each new tab in the array, such as Custom_taB2, my_new_tab, etc. $ TABS [\u0026#39; CUSTOM_TAB \u0026#39;] \u003d array (\u0026#39; title \u0026#39; \u003d \u0026 gt; __ (\u0026#39; CUSTOCUCT TAB \u0026#39; Woocommerce \u0026#39;), / / /Change the \”CUSTOM PRODUCT TAB\” to any text you want \u0026#39; priority \u0026#39; \u003d \u0026 gt; 50, \u0026#39; callback \u0026#39; \u003d \u0026 gt; \u0026#39; ql_custom_tab_content \u0026#39; );返回$标签;}// 将内容添加到自定义产品选项卡功能ql_custom_product_tab_content() {// 自定义标签内容//您可以在此处添加任何php 代码,它将显示在您新创建的自In the definition tab echo \u0026#39; \u0026 lt; h2 \u0026 gt; custom product label content \u0026 lt;/h2 \u0026 gt; \u0026#39; echo \u0026#39; \u0026 lt; Lorem iPSum Dolor sit, Consectetur Adipiscing Elit. Anen Facilisis in Rutrum. Morbi Quis Sodales Felis. \u0026 lt;/p \u0026 gt; \u0026#39; echo \u0026#39; \u0026 lt; img src \u003d \u0026 quot; http: //hypernova/wp-uploads/2021/logo-1.jpg\u0026quot; width \u003d \u0026 quot; 300 \u0026 Quot; Height \u003d \u0026 quot; 400 \u0026 quot; align \u003d \u0026 quot; center \u0026 quot; \u0026 gt; \u0026#39;}

finished! Now you can navigate to the front end of the site and verify the change.

Now, the above code fragment can only be used to add custom product tabs to all products in Woocommerce. But what if you only need to add custom product labels to specific products? Well, we have prepared a clip for you to complete the job. Let’s take a look. 2.3. Only add the custom product tab to a specific product

First, you need to get the product ID of the product to add a custom tab. Just turn to your 添加新片段 WP management instrument board

And navigation to

Product \u0026 GT; All products.

Hanging the mouse on the product you want, it will display the product ID. Save this Product-ID, because we need to add it to our code fragment later.

Copy and paste the following code clips to

Functions.php

file or code snippets plug -in, no matter which method you use. Keep in mind the replacement of the placement symbol to your actual product-id.

//添加一个新的自定义产品选项卡add_filter(\u0026#39;woocommerce_product_tabs\u0026#39;, \u0026#39;ql_specific_custom_product_tab\u0026#39;);功能ql_specific_custom_product_tab( $tabs ) {全球$产品;/ /Get the product ID. Replace it with your actual product IDIF ($ Product- \u0026 GT; get_id () \u003d\u003d 1911) {// Add new tags // Add multiple tags, update $ tabs [\u0026#39; xyz \u0026#39;] The labels of each new label, such as CUSTOM_TAB, My_new_tab, etc. $ TABS [\u0026#39; SPECIFIC_PRODUCT_TAB \u0026#39;] \u003d Array (\u0026#39; Title \u0026#39; \u003d \u0026 GT; __ (\u0026#39; Specified Tab \u0026#39 ;, 39; /Change the \”Specific PRODUCT TAB\” to any text you want \u0026#39; priority \u0026#39; \u003d \u0026 gt; 50, \u0026#39; callback \u0026#39; \u003d \u0026#39; ql_product_tab_content \u0026#39; );} Return $ tags;} // Add the content to the custom product tab function QL_SPECIFIC_PRODUCT_TAB_CONTENT () {// Custom label content // You can add any PHP code here, it will be displayed in your new creation Echo \u0026#39; \u0026 lt; h2 \u0026 gt; specific product label content \u0026 lt;/h2 \u0026 \u0026#39; echo \u0026 lat; \u0026 lt; Lorem IPSUM DOLOR SITAMET, Consectetur adipiscing elit. Morbi Quis Sodales Felis. \u0026 lt;/p \u0026 gt; \u0026#39; echo \u0026#39; \u0026 lt; img src \u003d \u0026 quot; http: //hypernova/wp-uploads/2021/logo-1.jpg\u0026quot; width \u003d \u0026 quot; 300 \u0026 Quot; Height \u003d \u0026 Quot; 400 \u0026 Quot; Align \u003d \u0026 Quot; Center \u0026 Quot; \u0026 GT; \u0026#39;}

 

That’s it. Your new custom product tab is now applied to the products you need, and will only be displayed for the product.

将自定义产品选项卡添加到 WooCommerce 所有产品

So far, you have seen the code fragment of adding custom product tabs to a single product and all products in Woocommerce. Let’s go further and see more code clips come to define product tabs.

2.4. Re -rename product tag

Sometimes you may need to replace the title of the custom tab, and even change the name of the default tab. For example, for TV programs or movies, you may want to change the \”Comment\” tab to \”scoring\”. Using the following code fragment allows you to easily change the title of the custom product.

//重命名WooCommerce 中的产品选项卡add_filter(\u0026#39;woocommerce_product_tabs\u0026#39;, \u0026#39;ql_rename_product_tabs\u0026#39;, 98);功能ql_rename_product_tabs( $tabs ) {//将$ Tabs [\u0026#39; xyz \u0026#39;] label in the array replaced your actual label tags $ tabs [\u0026#39; Reviews \u0026#39;] [\u0026#39; title \u0026#39;] \u003d __ (\u0026# 39; ratings \u0026#39;); // Re -name comment tags $ tabs [\u0026#39; custom_tab \u0026#39;] [\u0026#39; title \u0026#39;] \u003d __ (\u0026#39; custom tag update \u0026#39 ;); // Renamed the custom tab created by the user. Return to $ tags;} Great! Your product tab has been renamed. You can now navigate to the front end of the siteAnd verify the change by yourself.

在 WooCommerce 中获取产品 ID

2.5. Re -sort the tab

The following code fragment allows you to change the order of the product tab. It is based on priority.

The smaller the numbers, the higher the priority, the larger the number, the lower the priority. Therefore, the highest priority tab is first displayed, and then the next tab, the minimum priority tab will be located in the last position.

 

If you look at the following code, it will use some product tabs to demonstrate its working principle. If you need, you can add more product tabs, and then sort according to your preference. Just make sure the tag title is replaced with your actual label title.

//在WooCommerce 中重新排序产品选项卡add_filter(\u0026#39;woocommerce_product_tabs\u0026#39;, \u0026#39;ql_reorder_product_tabs\u0026#39;, 98);功能ql_reorder_product_tabs( $tabs ) {//根据优先Sort the tabs of the level of level value // Subtract the label in the array of $ tabs [\u0026#39; xyz \u0026#39;] to your actual tag tabs [\u0026#39; description \u0026#39;] [\u0026#39; Priority \u0026#39;] \u003d 5; // First describe $ tabs [\u0026#39; custom_tab \u0026#39;] [\u0026#39; Priority \u0026#39;] \u003d 10; // Customized tab second. $ tabs [\u0026#39; specific_product_tab \u0026#39;] [\u0026#39; Priority \u0026#39;] \u003d 15; // The third product label third. $ tabs [\u0026#39; Reviews \u0026#39;] [\u0026#39; Priority \u0026#39;] \u003d 20 ;/ The final comment returns the $ tag;}

在 WooCommerce 中为特定产品添加自定义产品选项卡 That’s it! You have now sorted the product tabs in your own custom order. Now you can navigate to the front end of the Woocommerce store to verify the change.

2.6. Delete the label

Now you have added all these tabs, but what if you want to delete them now? Well, it turns out that there is a code fragment that can delete all unwanted product tabs from your product page.

 

The following code fragment is suitable for default and custom product tabs. Remember to use youThe actual label title changes the label title.

//删除WooCommerce 中的产品选项卡add_filter(\u0026#39;woocommerce_product_tabs\u0026#39;, \u0026#39;ql_remove_custom_product_tabs\u0026#39;, 98);功能ql_remove_custom_product_tabs( $tabs ) {//将$tabs [\u0026#39; xyz \u0026#39;] The label in the array is replaced by your actual tag label is not set ($ tabs [\u0026#39; Reviews \u0026#39;]); [\u0026#39; description \u0026#39;]; // Remove the description labels not set ($ tabs [\u0026#39; custom_tab \u0026#39]); // Delete the custom tab created by the user. Return to $ tags;}

重命名 WooCommerce 产品选项卡 That’s it. The product label you don’t need has been successfully deleted. You can now navigate to the front end of the Woocommerce store and verify the change.

Above, we have seen how to use a third -party plug -in and add a custom product tab to the Woocommerce in programming. Let’s continue to look at other methods of organizing Wooocommerce products.

bonus: How to sort the WooCommerce product

There are two things to classify the product in a specific order. First, it allows you to display them by placing some products on the top of the page. Secondly, because the product is organized in a logical way, it makes it easier for customers to find or roll to browse the product.

Product sorting options in WooCommerce

 By default, WooCommerce provides six sort options and allows you to select one of them as the default sorting method. These options include: 

The default sort (custom sort+name):

The product is sorted by the name by default, but at the same time allows you to customize the sorting product. This is useful for highlighting products that do not meet a single standard. 重新排序 WooCommerce 产品标签

Popularity (Sales):

Arrange products according to the order of sales, ranking your best -selling products first.

Average score:

Sort the product according to the average score of the product. The highest scoring products get the highest position, followed by the next, and push it according to this.

 

According to the latest sorting:

According toThe product is added to the store to sort the product. This will bring your latest products to the top, which is conducive to highlighting the latest added products.

Sorting by price (ASC, DESC):

According to your choice, the product is sorted according to the price of the product or the order.

Change the default product sorting method in Woocommerce

Now, in order to change the default sorting method in WooCommerce, please go to

WP Admin Dashboard

and navigate to

Apperance \u0026 gt; Customize . This will take you into the theme customizer.

In the theme customizer, transfer to the product directory menu. Now, turn to the default product sorting part, and then click the drop -down menu. Select the sorting method you like and click

to publish

to save the change.

It’s great! You have now chosen the product classification method you like. However, these are not the only way to classify the product. You can classify the Woocommerce products through many other methods and methods. If you are interested, please check our detailed guidelines on how to classify the Woocommerce product.

Conclusion

In short, custom product tabs are very useful because they can help you present information about product information in a more organized way. Organizing product information in a separate tab allows customers to easily discover the information they need and make a better purchase decision.

In addition, it also allows the owner to add all basic information about the product without filling the entire page and making users overwhelmed. To some extent, this is a win -win situation for everyone.

In short, we have seen a variety of methods to add custom product tabs to Woocommerce:

Use plug -in Programming [

[ 123]

Let’s start with the custom product tab of the Woocommerce plugin to understand how to use the plug -in to add a custom product tab. We also see its \”saved label\” function, which allows us to save common labels for future use. WordPress 定制器手册 After

, we checked the code fragment of the custom product tab to add a custom product tab to WooCommerce. We see fragments that add product tags to all products and only specific products. In addition, we also checked the rename, sorting and deletingExcept the code fragment of the product tab.Finally, we organize the store page by checking the Woocommerce product classification option.

Have you tried adding a custom product tab to WooCommerce?What method did you use?What is your experience?Please tell us in the comments below.

If you want to understand more information about improving the WoOOCOMMERCE website, there are some posts you may be interested in:

WooCommerce 中的默认产品排序选项 How to customize the Woocommerce template

SelfDefine the best plug -in plug -in of the WoOOCOMMERCE product page

How to delete the additional information tabs in Woocommerce

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *