In this tutorial you will learn how to add custom fields and taxonomies to your WooCommerce products.
This guide is the fifth step of our WooCommerce tutorial: How to build an e-commerce website in 12 steps.
This tutorial uses the Toolset Types plugin.
Use the free training site, which allows you to follow the entire tutorial, step by step, from inside the WordPress admin area.
Your training site will include sample products and all needed plugins installed.
Before we add these extra pieces of information to our products, we need to decide which WordPress structure will work best for each. Basically, WordPress offers two ways for storing additional information for your posts:
If you already know the difference between these two, feel free to skip to the next section.
Let’s take a closer look at the specific information we want to enhance our products with. This will enable us to decide when to use a custom field and where a taxonomy fits better.
“Special offer” will include promotional text about certain products to make them more attractive for potential buyers.
Only some of our products will have a special offer available, and the offer for each product will have its own wording.
The “Special offer” is definitely a piece of “arbitrary extra information”. That’s why we implement “Special offer” using a custom field.
Most shops have different departments for women, men, and children. So we understand that gender is a way to group products. This means that we should implement “gender” as a custom taxonomy.
When you need to organize products by a different criterion, you should create a new custom taxonomy.
Let’s see how you add a new custom field to your WooCommerce products.
In our case, we need a text field to store a short promotional message, so we choose the Single line field.
Your group with a custom field is ready. Let’s populate it with some data.
Your taxonomy is ready.
If you open any product for editing, you should now see the new “Gender” taxonomy on the sidebar.
Before we start using the Gender taxonomy, we need to create the actual genders: Men, Women, and Children. These are called taxonomy terms in WordPress terminology.
When all your gender terms have been set up, you can assign your products to them. If you want to set a single gender for a few products at once, use WordPress’s “Bulk Edit” feature.
In this tutorial, you learned how to add a custom field and a custom taxonomy to your WooCommerce products so they appear in your WordPress admin.
Toolset allows you to add some of the most important features for your website in less time than ever. That’s because with Toolset you do not need to write PHP – saving you hours of needless coding.
You no longer need to manage dozens of complex plugins for your website. You can use the full Toolset package to build, run and maintain it all.
Whether you are a WordPress newbie or an experienced web developer, we have the plan for you based on your needs and budget.