Reply 176164 to: How i can show Brand on single product page and shop page?

Avatar: Rose Tyler
Rose Tyler
Support staff
October 26, 2017 at 14:32

In this case, you may add this code in function.php file of your child theme:

add_action('woocommerce_single_product_summary', 'et_print_brands', 10);

function et_print_brands(){

    global $post, $product;
    $terms = wp_get_post_terms( $post->ID, 'brand' );

    if(count($terms)>0) {
        ?>
			<p>Brands: 
            <?php
                foreach($terms as $brand) {
                    $image          = '';
                    $thumbnail_id   = absint( get_woocommerce_term_meta( $brand->term_id, 'thumbnail_id', true ) );
                    ?>
                    <a href="<?php echo get_term_link($brand); ?>">
                        <?php
                            echo $brand->name;
                        ?>

                    </a>
                    <?php
                }
            ?>

            </p>
				
        <?php
    }
}

Regards

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.