PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]
Cyber Monday 2021
Cyber Monday 2021 timer

Support Forum

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

WOOCS + User Role minimum order amount

This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see blue-green button on the right side) and press Save button.
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.

Добрый день.

Хочу поблагодарить Вас за замечательный и свех удобный плагин! Скажите пожалуйста, можно ли адоптировать такую кастомную функцию. На сайте 2 валюты EUR (базовая) и UAH. Установлены мин. заказ для каждой роли. Если выбран EUR. минималка - 20€, если гривна, то тоже 20грн (а не 625)

Please tell me if it is possible to adopt a custom function. There are 2 currencies in my shop EURO (base) and UAH. And was set min. order amount for each role. If EURO is selected. the minimum amount is 20€, if the hryvnia, then also 20 UAH (not 625)

 

Spoiler

add_action( 'woocommerce_check_cart_items', 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
    // minimum order value by user role
    if ( current_user_can('distributor_prices') )
        $minimum = 200; 
    elseif ( current_user_can('wholesale_prices') )
        $minimum = 500;
    else 
        $minimum = 20; // default

    if ( WC()->cart->subtotal < $minimum ) {

        if( is_cart() ) {
            wc_print_notice( sprintf( 
                'Мин. сумма для размещения заказа - %s. Ваша текущая сумма составляет - %s.' , 
                wc_price( $minimum ), 
                wc_price( WC()->cart->subtotal )
            ), 'error' );
        } else {
            wc_add_notice( sprintf( 
                'Мин. сумма для размещения заказа - %s. Ваша текущая сумма составляет - %s.' , 
                wc_price( $minimum ), 
                wc_price( WC()->cart->subtotal )
            ), 'error' );
        }
    }
}

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

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

Добавьте  код  сюда - https://share.stackovergo.com/image/i20210818113444.png

if (class_exists('WOOCS') ) {
global $WOOCS;

$minimum= $WOOCS->woocs_exchange_value(floatval($minimum));

 }

Спасибо большое!

Пожалуйста;)