Display User Type in Product Details Page woocommerce
Question
add_filter('woocommerce_short_description','ts_add_text_short_descr');
function ts_add_text_short_descr($description){
global $authordata;
$author_roles = $authordata->roles;
$author_role = array_shift($author_roles);
$st_text="<h1 Sold By: >";
$cl_text="</h1>";
return $description.$st_text.$author_role.$cl_text;
}
By using the above code I am able to display author user type in a product details page. Its a multi-vendor site. It has a user type says “Whole-seller”. When a user that particular user type adds a product I would like to display a text like Sold By: Whole-seller. But that text shouldn’t be shown when any other user type adds any product. Kindly help. Thanks in advance
0
woocommerce, wordpress.org
3 years
2020-07-16T08:11:33-05:00
2020-07-16T08:11:33-05:00 0 Answers
52 views
0
Leave an answer