Is there any possible way to add brand logo on the product thumbnail grid?
I know I have to hand down on a code? can you please tell me which file?
There is an example of what I want: https://i.imgur.com/Q577trR.jpg
This topic has 4 replies, 3 voices, and was last updated 4 years, 6 months ago ago by Rose Tyler
Is there any possible way to add brand logo on the product thumbnail grid?
I know I have to hand down on a code? can you please tell me which file?
There is an example of what I want: https://i.imgur.com/Q577trR.jpg
Hello,
Add the below code to child theme functions.php
add_action('woocommerce_before_shop_loop_item', 'eth_product_brand_image');
function eth_product_brand_image() {
global $post;
$terms = wp_get_post_terms( $post->ID, 'brand' );
?>
<div class="sidebar-widget product-brands">
<h4 class="widget-title"><span><?php esc_html_e( 'Product brand', 'xstore' ) ?></span></h4>
<?php
foreach ( $terms as $brand ) {
$thumbnail_id = absint( get_term_meta( $brand->term_id, 'thumbnail_id', true ) );
?>
<a href="<?php echo get_term_link( $brand ); ?>">
<?php if ( $thumbnail_id ) :
echo wp_get_attachment_image( $thumbnail_id, 'full' );
endif; ?>
</a>
<?php
}
?>
</div>
<?php
}
Regards
Thanks, Olga Barlow 🙂
Hello Sayeed,
We’d appreciate if you could take a moment to give us 5-stars on ThemeForest! https://themeforest.net/downloads
Regards
The issue related to '‘Can i add brand logo on the product thumbnail grid?’' has been successfully resolved, and the topic is now closed for further responses