Answer the question
In order to leave comments, you need to log in
How to get the name of a product attribute term by slug?
It didn't work out that way:
global $product;
$term = get_term_by( 'slug', 'Ink_black', 'product' );
Answer the question
In order to leave comments, you need to log in
Because 'product' is a post type, not a term. Try using 'product_tag'
$term = get_term_by( 'slug', 'ink_black', 'product_tag' );
var_dump( $term->name );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question