I have variable product with attribute URL that is used for variations.
I need to display it on page but I dont know how. I tried many ways but nothing was OK. For example this code:
echo get_post_meta($value['variation_id'], 'attribute_pa_url', true);
returns url like "httpwww-domain-comsometthingsomethingelse" instead of "http://www.domain.com/sometthing/somethingelse"
Any hint what I should do? Thank you!
That worked:
$taxonomy = 'pa_color';
$meta = get_post_meta($value['variation_id'], 'attribute_'.$taxonomy, true);
$term = get_term_by('slug', $meta, $taxonomy);
echo $term->name;
Thanks to Reigel!