• Resolved Gvas20

    (@gvas20)


    Hi

    How can you put a rule when someone wants to use payment and partial payment ?

    The rule, i want to insert is that when someone collect an amount of cashback, then can use on checkout

    For example when someone has at least 20 euro can use the wallet,if the amount is lower than20 , he cant.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @gvas20 Please use the attached code in theme functions.php file for this requirement.

    add_filter( 'woo_wallet_payment_is_available', 'woo_wallet_payment_is_available_callback', 10, 1 );
    if ( ! function_exists( 'woo_wallet_payment_is_available_callback' ) ) {
    function woo_wallet_payment_is_available_callback( $is_available ) {
    if ( woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ) < 20 ) {
    $is_available = false;
    }
    return $is_available;
    }
    }

    add_filter( 'woo_wallet_disable_partial_payment', 'woo_wallet_disable_partial_payment_callback', 10, 1 );
    if ( ! function_exists( 'woo_wallet_disable_partial_payment_callback' ) ) {
    function woo_wallet_disable_partial_payment_callback( $is_disabled ) {
    if ( woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ) < 20 ) {
    $is_disabled = true;
    }
    return $is_disabled;
    }
    }
    Thread Starter Gvas20

    (@gvas20)

    It’s ok!Work

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.