My custom taxonomy (WooCommerce attribute) already exists and I am using the following to add a new term to the taxonomy and associate it with my WooCommerce product:
wp_set_object_terms($product_id, array($omega_jahr), 'pa_years-of-construction');
When I use the following to call the 'pa_years_of_construction' for my product, I can see that the new terms have been saved:
$v = array_values( wc_get_product_terms( $product->id, 'pa_years-of-construction', array( 'fields' => 'names' ) ) );
However, when I check my product attributes in the backed and frontend of my website, the 'pa_years_of_construction' attribution isn't showing up.
What am I missing here?
Thanks in advance for any help!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…