1

Id like to use product tags as a second classification for products from the Add New Product menu, however the product tag option in its default state is not reliable.

Id like to customise it so that I could select from a complete list with checkboxes as is done with categories. The product tags populate one of my dropdown menus, so they need to be consistent, created in the Tag menu, much like Categories and not created on the fly, duplicated, or be similar to others, as is the case with Tags currently.

I have used some code previously which created a tag cloud to choose from, but it was never a complete list and not ideal.

Can this be done? And is it the best option for achieving a second product classification from the product page. Im trying to avoid plugins.

1

That's only one way to achieve that, but it's the easiest, I guess.

The taxonomy UI is displayed as list of checkboxes, if given taxonomy is hierarchical.

So if you change the product tags to hierarchical, it will solve your problem.

And it's pretty easy to change, because there's a hook for that:

function my_woocommerce_make_tags_hierarchical( $args ) {
    $args['hierarchical'] = true;
    return $args;
};
add_filter( 'woocommerce_taxonomy_args_product_tag', 'my_woocommerce_make_tags_hierarchical' );
  • Amazing. I have been trying to do this for a long time. Thanks a lot :) – Whee Nov 28 '19 at 23:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.