0

I am writing a code that would display the user defined additional content on woocommerce email setting only when a user is a vendor.

I have tried using different functions to identify if a user is a vendor on the dokan-lite multivendor plugin but without any success. Here is the last code I tried to use:

/** 
* Show user-defined additional content. 
*/ 
if ($additional_content && dokan_is_seller_enabled(get_current_user_id())) { echo wp_kses_post(wpautop(wptexturize($additional_content))); } 

For everything I have tried, it fails to identify users that are vendors. I have also tried to check if user has certain permissions peculiar to vendors but still no result.

Trying to use this to include additional contents in the woocommerce emails for only vendors

xhebruski
  • 1
  • 1

1 Answers1

0

you can use the dokan_is_user_seller() function instead of dokan_is_seller_enabled() to check if the user is a vendor. It checks if the user is a vendor in Dokan Lite.

if ($additional_content && dokan_is_user_seller(get_current_user_id())) {
    echo wp_kses_post(wpautop(wptexturize($additional_content)));
}
hareth py
  • 112
  • 6