Let’s suppose I have terms like that :

SAMSUNG > PROTECTION > COVER
and
IPHONE > PROTECTION > COVER

and in codex, I have product that have these terms :
SAMSUNG, PROTECTION, COVER

how I can insert them to product? I can’t use

wp_set_object_terms( $post_id, 'COVER', 'product_cat' );

as I have also COVER in iphone, I tried many solutions but none work.

Thanks

Read more here: How to insert term by name (by parent)


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: