This topic has 4 replies, 3 voices, and was last updated 4 years, 4 months ago ago by Olga Barlow
Hi,
Currently my shop displays the product saying “sold by [vendor name].
How do i change it so that is displays “sold by [shop name]”.?
Hi,
To show it you just need to add the following code to child theme functions.php
add_action( 'woocommerce_after_shop_loop_item_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,
Hung PD
Hi Hung,
i put the code into xstore child theme but nothing changed.
just to clarify, i would like it to show the shop name.
currently its still showing the seller name.
please provide alternative solution thanks.
Hello,
Could you, please, provide us with temporary WP Dashboard and FTP access to your site to check and help you?
Regards
You must be logged in to reply to this topic.Log in/Sign up