PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

force any currency only for specific user roles

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Добрый день,  помогите пожалуйста адаптировать данный код к ролям пользователей

add_filter('wp_head',function(){
global $WOOCS;
$WOOCS->set_currency('USD');
});

Скажем на сайте есть следующие user roles: customer, partner, reseller

Как сделать, чтоб только для последних двух валюта во во всем магазине была только USD.

Заранее благодарен за Вашу помощь!

Здравствуйте

прочитайте  это  - https://wordpress.stackexchange.com/questions/5047/how-to-check-if-a-user-is-in-a-specific-role

в Вашем случае

$user = wp_get_current_user();
if ( in_array( array('apartner','reseller'), (array) $user->roles ) ) {
    //code
}