Last active
September 16, 2021 10:12
-
-
Save Korveld/3f6932a321bbb6dda0005406bdda7787 to your computer and use it in GitHub Desktop.
Woocommerce show brand names in product page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'woocommerce_single_product_summary', 'artlife_add_brand_name_to_product_page', 19 ); | |
| function artlife_add_brand_name_to_product_page() { | |
| global $post; | |
| $brands = wp_get_post_terms( $post->ID, 'product_brand', array("fields" => "all") ); | |
| foreach( $brands as $brand ) { | |
| echo __( 'Brand', 'pharmacy') . ': ' . $brand->name; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment