Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter edoardo90

    (@edoardo90)

    I got it done with the function

    add_filter(‘process_woo_wallet_general_cashback’, ‘process_woo_wallet_general_cashback_callback’, 10, 2);
    function process_woo_wallet_general_cashback_callback($process, $order){
    if(‘wallet’ === $order->get_payment_method(‘edit’)){
    return false;
    }
    return $process;
    }

    but when it is a mixed payment say for example 50% cash and 50% wallet credits it still gives cashback on the credits. Any way to not make that happen so customer only gets cashback on money spent and not credits spent?

    Thread Starter edoardo90

    (@edoardo90)

    Also I want it to not give cashback on the shipping payment. For that I used this code which worked perfectly as it gets the amount from the subtotal. The problem is that the discounted amount is after credits are aplied. Any way to eliminate cashback from shipping and when customer pays with credits?

    if (!function_exists(‘woo_wallet_form_cart_cashback_amount_callback’)) {
    function woo_wallet_form_cart_cashback_amount_callback($cashback_amount) {
    $cashback_rule = woo_wallet()->settings_api->get_option(‘cashback_rule’, ‘_wallet_settings_credit’, ‘cart’);
    $global_cashbak_type = woo_wallet()->settings_api->get_option(‘cashback_type’, ‘_wallet_settings_credit’, ‘percent’);
    $global_cashbak_amount = floatval(woo_wallet()->settings_api->get_option(‘cashback_amount’, ‘_wallet_settings_credit’, 0));
    $max_cashbak_amount = floatval(woo_wallet()->settings_api->get_option(‘max_cashback_amount’, ‘_wallet_settings_credit’, 0));
    if (‘cart’ === $cashback_rule) {
    if (‘percent’ === $global_cashbak_type) {
    $percent_cashback_amount = wc()->cart->get_subtotal(‘edit’) * ( $global_cashbak_amount / 100 );
    if ($max_cashbak_amount && $percent_cashback_amount > $max_cashbak_amount) {
    $cashback_amount = $max_cashbak_amount;
    } else {
    $cashback_amount = $percent_cashback_amount;
    }
    } else {
    $cashback_amount = $global_cashbak_amount;
    }
    }
    return $cashback_amount;
    }
    }

    Plugin Contributor Moumita Adak

    (@moumitaadak)

    @edoardo90 Hi, Sorry for the delay in response. We will add a new filter in the next update then you can easily crop the cashback amount.

    Thank You

    Plugin Contributor Moumita Adak

    (@moumitaadak)

    @edoardo90 Please update the plugin to the latest version then use
    woo_wallet_calculate_cashback_on_total filter.

    Thank You

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Cashback from payments done with credits’ is closed to new replies.