set a parent category in a product woocommerce

I use this function to set a new category

wp_set_object_terms($product_id, $data[1], ‘product_cat’);

but i’d like to add a parent at this category… how could I do?

Read more here: set a parent category in a product woocommerce

Leave a Reply

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