Answers for "woocommerce get product category of the current post"

0

woocommerce get product categories

$terms = get_the_terms( $product_id, 'product_cat' );
foreach ($terms as $term) {
    $product_cat_id[] = $term->term_id;
}
Posted by: Guest on July-23-2021
0

woocommerce get post terms product

$term_obj_list = get_the_terms( $post->ID, 'taxonomy' );
$terms_string = join(', ', wp_list_pluck($term_obj_list, 'name'));
Posted by: Guest on November-18-2020

Code answers related to "woocommerce get product category of the current post"

Browse Popular Code Answers by Language