I added custom attributes to my products, and I would like to show one of these on the product loop page(loop/price.php). The attribue name is: “garan”.
$garanvalues = get_the_terms( $product->id, 'pa_garan');
foreach ( $garanvalues as $garanvalue ) {
echo $garanvalue->name;
var_dump($garanvalue);
}
I used the code above, but the var_dump output the following:
array(1) { ["invalid_taxonomy"]=> array(1) ..
I hope you know solution. Thank you very much!
If the taxonomy name is garan then use garan as parameter for get_the_terms function instead of pa_garan.