To add the sold by vendor name in a custom section on a single product page you need to add the below code in the functions.php file of your current active theme
add_shortcode('mvx_sold_by', 'mvx_sold_by_shortcode');
function mvx_sold_by_shortcode() {
global $post;
if (!$post) return;
if (get_mvx_vendor_settings('display_product_seller', 'settings_general') && apply_filters('mvx_sold_by_text_after_products_shop_page', true, $post->ID)) {
$vendor = get_mvx_product_vendors($post->ID);
if ($vendor) {
$sold_by_text = apply_filters('mvx_sold_by_text', __('Sold By', 'multivendorx'), $post->ID);
echo '<a class="by-vendor-name-link" style="display: block;" href="' . $vendor->permalink . '">' . $sold_by_text . ' ' . $vendor->page_title . '</a>';
do_action('after_sold_by_text_shop_page', $vendor);
}
}
}
And then add this short code in the elementor page –
[mvx_sold_by]
Leave a Reply
You must be logged in to post a comment.