Hello @shaar7 ,
I have an interesting solution for you. Please note that, according to our support policy I am restricted to provide customization solutions. I only share the information that I already have ready or can be modified according to your need. For full solutions I will recommend to contact an expert. Now, let’s see how can we achieve the result you want.
The only thing you need to get the vendor user ID to select each vendor. There are tons of ways for that, see – https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/
The code you will use is this –
// First remove the original filter to show vendor name
remove_filter( 'woocommerce_get_item_data', 'dokan_product_seller_info', 10, 2 );
function dokan_product_seller_info_hide_chosen_ones( $item_data, $cart_item ) {
$vendor = dokan_get_vendor_by_product( $cart_item['product_id'] );
$hide_vendor = array(2); //add the vendor IDs that should not show the names
if ( ! $vendor ) {
return $item_data;
}
if ( !in_array($vendor->get_id(), $hide_vendor) ) {
$item_data[] = array(
'name' => __( 'Vendor', 'dokan-lite' ),
'value' => $vendor->get_shop_name(),
);
}
return $item_data;
}
// Adds our custom vendor names with conditions
add_filter( 'woocommerce_get_item_data', 'dokan_product_seller_info_hide_chosen_ones', 10, 2 );
I hope you will share your appreciation by rating us on www.ads-software.com.
Thank you ??