A freelance client hired me to display each product brand in the shop/product archive pages. The WooCommerce Brands plugin, in fact, only adds these in the Single Product Page.
So, this is how it’s done. Enjoy!
PHP Snippet: Display “Brands” @ WooCommerce Shop & Product Archives – WooCommerce Brands Plugin
/**
* @snippet Display "Brands" @ Shop/Loop - WooCommerce
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 5
* @community https://businessbloomer.com/club/
*/
add_action( 'woocommerce_after_shop_loop_item_title', 'bbloomer_show_woocommerce_brands_loop', 8 );
function bbloomer_show_woocommerce_brands_loop() {
global $post;
echo get_brands( $post->ID );
}
Hi,
It does not work for me. I am using Kadence Shop Kit to showing for my brands.
And when add this code it will be some trouble in my store and wordpress want me to trouble shooting.
Can this be the Kadence Shop Kit Plugin that the code does not work with? Thanks!
Not sure. If you disable Kadence and enable WooCommerce Brands, does it work?
It still works! Also adjusted it myself to make it above the product title which is awesome. But how do you remove the link to the brand or just link to the product versus the brand page? I know custom code. Reaching out for quote.
Cool! To remove the link, you need a workaround with remove_action as the whole block of content is wrapped into a link. Thanks for reaching out
Hi Rodolfo,
Is it possible to show brand thumbnail on the top side corner of the products in the shop page? The brand thumbnail (logo) will be stacked on top of the product thumbnail. Is it doable with this plugin or doable at all? Appreciate your advise!
Thank you!
Hi Jimmy thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi!
Is it possible to have it over the product title?
Hi Martin, try changing hook: https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/
Hello,
Thank you for your help. It works perfectly. Is it possible to display only the “parent” brand ?
Hi Karim, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hey
How to set logo image above title in product page?
Hi Bar, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Thanks! works great, is there a way to make it:
Image
Brand
Title
Price
Currently Brand is after the title.
Ivan, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi, it doesn’t work, it gets a reply while uploading the code:
Uncaught Error: Call to undefined function get_brands() in wp-content/themes/astra/functions.php:168
Stack trace:
#0 wp-includes/class-wp-hook.php(287): bbloomer_show_woocommerce_brands_loop(”)
#1 wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
#2 wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 wp-content/plugins/woocommerce/templates/content-product.php(57): do_action(‘woocommerce_aft…’)
#4 wp-includes/template.php(732): require(‘/home/sinkevic/…’)
#5 wp-content/plugins/woocommerce/includes/wc-core-functions.php(283): load_template(‘/home/sinkevic/…’, false)
#6 wp-conte
What Brands plugin are you on?
Brilliant, thank you! Just added it to my store and it still works.
Yay!
Dear Rodolfo,
thank you for this snippet, it is really helpful. Somehow the brand name appears below all the other information (price, price per liter, shipping …), just above the buy-button. Is there an easy way to make it appear right below the product name? Thank you.
David
Hi David, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
You can put the brand image instead of the title, in the same place with some code
Cool. Share it here maybe?
Hello,
Your code doesn’t work at all, I bought The WooCommerce Brands plugin because of your article, so I activate the plugin, add your code in the child theme function.php but nothing happen. Can you try to help me ? I will be very thankful !
I’m using :
WordPress : 5.2.3
Elementor Pro : 2.6.5
WooCommerce : 3.7.0
Do you get any PHP error?
Hello,
Unfortunately this code doesn’t work with my site. It says: the site is experiencing technical difficulties.
I also tried with twenty seventeen theme (no error but no brands showing). Any ideas ?
I am using:
Theme: xstore
Wordpress: 5.2.2
Woocommerce: 3.6.4
Php: 7.1
Hi there, what error do you get exactly? Please copy/paste here the part of the WordPress email notification where it describes the issue. Thank you!
Here is the picture. The page width got shorten and there is only one product showing.
Error log:
https://shrani.si/f/1b/3l/98C8i5T/11.png
Hi there, are you using the official WooCommerce Brands plugin?
Hey! Still working & amazing – thank you! One question – what do I need to add to the code to be able to style the brand name? I was hoping to reference it and add the CSS to the live editor 🙂 Thank you!
Hello Sarah! Just add an HTML class to the PHP and then reference it in your CSS:
Hi Rodolfo, thank you very much for this code. Would it be possible to link the brand title to the actual product instead of the brand archive? Thank you again!
Hello Rika, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
hello sir,
I’m using perfect woocommerce brands plugin to display my brands . when somebody click on brand logo i just need the category of that brand to be displayed am new to wordpress please help me
Hey Anjana, thanks for your comment! Try ask the plugin developers please 🙂
Hi Rodolfo, Many thanks for sharing with us these code snippets.
It has really helped me out a lot. Your site is officially my “go-to” site for everything woocommerce.
I need some help here. I have browsed through lots of materials, I’ve not gotten any solution.
I want to show my custom taxonomies on the shop page, just like the way you’ve shown brands above.
Please, how do I go about it.
I have no experience in coding, please.
Many thanks, standing by.
Hello Prince – thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R
Still works.
Many Thanks 🙂
Best
David
Thank you David 🙂
Hi Rodolfo – is there an elegant way to hide the entire brand loop if there is no brand assigned?
We have a few products that are gift packs and contain items from a few different makers, so we generally leave the name blank. However I noticed it has been throwing errors in the error_log when these products are listed in the category loop (I think).
Hey Justin, thanks for your comment! Yes, you can just check if “get_brands” exists before echoing it. Hope this helps 🙂
Thanks!! Just what I needed. I find myself landing on your site more and more these days. Really appreciate your work!
Thank you so much Justin 🙂