This topic has 4 replies, 2 voices, and was last updated 3 years, 11 months ago ago by Olga Barlow
Xstore
Hello,
Option to display vendor on the single product page should be in the vendor plugin settings not in the theme because there are a lot of vendors plugins (Dokan, WC Multivendor, Product vendors, WCFM marketplace, WC marketplace etc ). Theme author can’t add tens of special option for every existing multivendor plugin, hope you understand.
To show the Dokan vendor name on the single product if you use single product builder try below code in the child theme functions.php
add_action( 'etheme_woocommerce_template_single_title','sold_by' );
function sold_by(){
global $product;
$seller = get_post_field( 'post_author', $product->get_id());
$author = get_user_by( 'id', $seller );
$vendor = dokan()->vendor->get( $seller );
$store_info = dokan_get_store_info( $author->ID );
if ( !empty( $store_info['store_name'] ) ) { ?>
<span class="details">
<?php printf( 'Sold by: <a href="%s">%s</a>', $vendor->get_shop_url(), $vendor->get_shop_name() ); ?>
</span>
<?php
}
}
Regards
Great! Thank you!
Hello,
It would be better to contact the plugin author and ask the code to display that information. We are not the developers of that plugin and did not study their code in detail.
Regards
The issue related to '‘Vendor name and information’' has been successfully resolved, and the topic is now closed for further responses