Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @themefour,

    It seems like you are using the code which was given by me to some customers who were trying to modify their Store page via Elementor and trying to show vendor bion in a custom place. The code will only work for the store page. If you need to show in a single store page then you have to check with the Global variable product and then you need to find the product author and then you need to get vendor bio from the store-info.

    As it is a customs requirement so, it is difficult for us to provide such level support. However, I had a similar blog to show vendor name on single product page which you can follow to do the code.

    Thanks!

    Thread Starter themefour

    (@themefour)

    I was able to easily display the seller’s (vendor) biography! Even without a shortcode!

    You are not yet in control of your own plugin templates. It is unfortunate.

    Hi darvishi, Im trying the same. show the vendor Bio in a single product page tab(vendor Info), could you please explain how you was able to do it? thanks

    I solve this using this code

    /**
    * Add a custom product data tab
    */
    add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ );
    function woo_new_product_tab( $tabs ) {

    // Adds the new tab

    $tabs[‘test_tab’] = array(
    ‘title’ => __( ‘Vendor Bio’, ‘woocommerce’ ),
    ‘priority’ => 50,
    ‘callback’ => ‘woo_new_product_tab_content’
    );

    return $tabs;

    }
    function woo_new_product_tab_content() {

    // The new tab content

    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: %s‘, $vendor->get_shop_url(), $vendor->get_shop_name() ); ?>
    </span>
    <br/>
    <?php
    }

    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[‘vendor_biography’] ) ) { ?>
    <span class=”details”>
    <?php printf( $vendor->get_vendor_biography() ); ?>
    </span>
    <?php
    }
    }

    my biography do not show up, i am using reign theme and reign dokan storemate plugin, i do not handle codes, so if you can provide instructions for dummies, of how to place this code will be helpful, bio is a most important matter in a household food products marketplace

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Vendor Bio’ is closed to new replies.