Answer the question
In order to leave comments, you need to log in
How to display custom ACF fields set for an attribute on a product page (woocomerce)?
Hey!
Created "trademark" attributes and added "trademark names" there.
ACFom added a text field for the "trademark" taxonomy, which is also available when editing "trademark names".
For example, in the trademark he created "Nike" and filled in a custom field for him, indicated a link to the official site.
Now you need to display the value of this custom field for all products that have the Nike attribute (link to the official website). Tell me which cycle to create, otherwise I’ve been muddling all day and everything is past ...
Answer the question
In order to leave comments, you need to log in
In a cycle.
$term = $product->get_attribute( 'pa_brand' );
$term = get_term_by('slug', $term, 'pa_brand');
the_field('url', 'pa_brand_'.$term->term_id);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question