This topic has 13 replies, 2 voices, and was last updated 7 years ago ago by Rose Tyler
Hello! How i can show Brand on single product page and shop page?
Thanks!
Hello,
You may add Brands widget in Shop page sidebar or Single product page Sidebar (Appearance > Widgets).
Regards
i mean i need shortcode or action . Check attachment pls
https://prnt.sc/h1qg44
You may use [brands]
shortcode.
If you plane to edit single product page in files, make changes in the child theme to prevent losing them after theme update.
Regards
if i use [brands] shortcode, i see all brans on the page. but i need show product brand on single product page.
Try to enable sidebar on single product page, by default brand will be shown here.
Regards
I need show product brand like screenshot
https://prnt.sc/h2a689
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
Great Thanks
You’re welcome!
Regards
and i need show brands on shop page can you check pls screenshot https://prnt.sc/h2ecxx
no prob i add action woocommerce_after_shop_loop_item_title. Thank you!
Hello,
I am glad that you sorted out.
Regards
You must be logged in to reply to this topic.Log in/Sign up