Vendor name and information - by amahol - on WordPress WooCommerce support

This topic has 4 replies, 2 voices, and was last updated 3 years, 11 months ago ago by Olga Barlow

  • Avatar: amahol
    amahol
    Participant
    May 27, 2020 at 01:37

    Xstore

    Please, contact administrator
    for this information.
    3 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 27, 2020 at 10:40

    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

    Avatar: amahol
    amahol
    Participant
    May 27, 2020 at 15:40

    Great! Thank you!

    Please contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 27, 2020 at 18:53

    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

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘Vendor name and information’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.