Home › Forums › Front-end Issues › WooCommerce Attribute Image to Single Product › Reply To: WooCommerce Attribute Image to Single Product
I got it working using the Wysiwyg Editor to upload the image instead. Thanks for your help.
The final code is
add_action('woocommerce_single_product_summary','finish_image',22);
function finish_image() {
$terms = get_the_terms( $post->ID , 'pa_metal-finish' );
if($terms) {
foreach( $terms as $term ) {
echo '<b>Finish: </b>'. get_field('finish_img', 'pa_metal-finish'.'_'.$term->term_id);
}
}
}
With use of the Wysiwyg Editor for image upload
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.