Is it possible to add custom fields to a WooCommerce attribute term?
It’s easy to add a custom field to a product in WooCommerce: Go to the product where you’d like to add a custom field. In the Product Data section, click the Product Add-Ons. Click ‘Add Group’ then click ‘Add Field’
How do I add metadata to WooCommerce?
Click Screen Options at the top of the page.
- In the Boxes panel, check Custom Fields.
- Scroll down, and you’ll see a new Custom Fields panel available.
- Click the Name dropdown menu to edit an existing metadata field in your theme.
- Alternatively, click the Enter New button to create a new metadata entry.
How to add custom Meta Field in WooCommerce?
Otherwise Woocommerce sees it as custom meta field (?). It still adds the value under attributes. This will only work for strings. For values that are arrays the code has to be adapted. Additionally it uses the wp_set_object_terms that @Anand suggests as well.
How to add a taxonomy term in WooCommerce?
@Daniels’s answer works, won’t decide on right or wrong, however if you want to add the values as a taxonomy term under attributes you have to adapt the code as below (set is_taxonomy = 1). Otherwise Woocommerce sees it as custom meta field (?). It still adds the value under attributes. This will only work for strings.
How to add a variable product in WooCommerce?
These are the steps: Go to Products > Add New. Enter a name and description for the product. Start with the name and description for the product. Select variable product from the product data meta box. You can select variable product from the product data meta box dropdown. Add attributes and values to the product.
What happens to the General tab in WooCommerce?
The first hook depends on which tab you want to display your field in. Keep in mind that tab visibility differs depending on product type. For example, “General” tab gets removed when you switch to a grouped product type.