Hello,
Sorry for the delay in answering.
Try the following code to register [et_single_product_brand_names] shortcode
add_shortcode( 'et_single_product_brand_names', 'et_single_product_brand_names' );
if ( ! function_exists( 'et_single_product_brand_names' ) ) {
function et_single_product_brand_names( $atts = array() ) {
$product_id = get_the_ID();
$terms = wp_get_post_terms( $product_id, 'brand' );
$brand = etheme_get_option( 'brand_title' );
if ( count( $terms ) < 1 ) {
return;
}
$_i = 0;
$brand_titles = '';
foreach ( $terms as $brand ) { $_i ++;
$brand_titles .= esc_html( $brand->name );
if ( count( $terms ) > $_i ) {
$brand_titles .= ", ";
}
}
return $brand_titles;
}
}
Regards