Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wc php get product category in product page

global $post;
$terms = get_the_terms( $post->ID, 'product_cat' );
foreach ($terms as $term) {
    $product_cat_id = $term->term_id;
    break;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wc #php #product #category #product #page
ADD COMMENT
Topic
Name
8+2 =