Home Forums Theme Support Dokan Best Sellers Widget displays personal name instead of store name

This topic is: resolved

This topic contains 8 replies, has 3 voices, and was last updated by  Sk 4 years, 10 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #23489

    Kevin
    Member
    Post count: 46

    Hello,

    First, I want to thank you for the wonderful support we have received. You have been very helpful in resolving a number of questions/issues we've had!

    Also, I did want to see if there was an easy way to display the “Store name” instead of the persons name in the Best Seller Widget. Currently the Best Sellers Widget displays the individuals personal name instead of the store name (It would be great to build this as an option into future releases).

    If you can tell me which PHP file to edit and what to replace it with that would be ideal.

    Thanks,
    Kevin

    #23558

    Sk
    Moderator
    Post count: 371

    Hello Kevin,

    Please navigate to dokan/includes/widgets/best-seller.php on line 49
    insert this following two line after the line $display_rating = $rating['rating'];

    $store_info = dokan_get_store_info( $value->seller_id );
    $store_name = isset( $store_info['store_name'] ) ? esc_html( $store_info['store_name'] ) : esc_html( $value->display_name );

    now replace the line
    <?php echo $value->display_name; ?>

    by
    <?php echo $store_name; ?>

    it should be on line 60 of the same page. done… ๐Ÿ™‚

    Thank you for make this issue. We are including this on our next update.

    #23567

    Kevin
    Member
    Post count: 46

    Thank you very much! It worked perfectly!

    #23670

    roderswiss
    Member
    Post count: 63

    Hello guys,

    in the product page we have the seller info tab. Under that tab Seller is shown as the vendors name instead of the Store name. How can we adjust that too?

    #23710

    Sk
    Moderator
    Post count: 371

    Hello roderswiss,

    On this tab dokan shows store name just before the seller name. If you want to make that store name as a link then please navigate to dokan/includes/wc-template.php on line 69

    replace the line
    <?php echo esc_html( $store_info['store_name'] ); ?>

    by
    <?php printf( '<a href="%s">%s</a>', dokan_get_store_url( $author->ID ), esc_html( $store_info['store_name'] ) ); ?>

    Thank you.

    #23725

    roderswiss
    Member
    Post count: 63

    Thanks Shaikat it worked perfectly.

    #23727

    Kevin
    Member
    Post count: 46

    Make that two thank you's!

    #24124

    Kevin
    Member
    Post count: 46

    Hello and thank you for the previous help!

    The last place I found that sellers personal name appears is within the cart. Can you direct me to which code needs to be changed to make this the store name?

    #24554

    Sk
    Moderator
    Post count: 371

    Hello Kevin,

    Please navigate to dokan/includes/wc-template.php on line 15. replace the function

    [php]
    function dokan_product_seller_info( $item_data, $cart_item ) {
    $seller_info = get_userdata( $cart_item[‘data']->post->post_author );

    $item_data[] = array(
    ‘name' => __( ‘Seller', ‘dokan' ),
    ‘value' => $seller_info->display_name
    );

    return $item_data;
    }
    [/php]

    by

    [php]
    function dokan_product_seller_info( $item_data, $cart_item ) {
    $seller_info = get_userdata( $cart_item[‘data']->post->post_author );
    $store_info = dokan_get_store_info( $seller_info->ID );
    $item_data[] = array(
    ‘name' => __( ‘Seller', ‘dokan' ),
    ‘value' => $store_info[‘store_name']
    );

    return $item_data;
    }
    [/php]

    it will work. thank you.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Best Sellers Widget displays personal name instead of store name’ is closed to new replies.