Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get woocommerce product category link by id

global $post;
$link = '';
$terms = get_the_terms( $post->ID, 'product_cat' );
if(!empty($terms[0])){
    $link = get_term_link( $terms[0]->term_id, 'product_cat' );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #woocommerce #product #category #link #id
ADD COMMENT
Topic
Name
8+2 =