Best Sellers Widget displays personal name instead of store name

  • Home
  • Forums
  • Dokan
  • Best Sellers Widget displays personal name instead of store name
This topic contains 8 reply and 3 voices, and was last updated by Sk 9 years, 8 months ago
Viewing 8 Posts - 1 through 8 (of 8 total)
Author Posts
July 14, 2014 at 12:46 am 23489
Sk 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
July 15, 2014 at 12:44 am 23558
Sk Sk

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.

July 15, 2014 at 2:52 am 23567
Kevin Kevin

Thank you very much! It worked perfectly!

July 16, 2014 at 6:14 pm 23670
roderswiss roderswiss

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?

July 17, 2014 at 3:44 pm 23710
Sk Sk

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.

July 17, 2014 at 6:59 pm 23725
roderswiss roderswiss

Thanks Shaikat it worked perfectly.

July 17, 2014 at 10:26 pm 23727
Kevin Kevin

Make that two thank you’s!

July 25, 2014 at 11:36 pm 24124
Kevin Kevin

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?

August 5, 2014 at 12:12 pm 24554
Sk Sk

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 8 Posts - 1 through 8 (of 8 total)