I want to enable partial payment on the checkout page all the time. 30 % payment can be done through the wallet and for 70% payment customer has to choose another payment option. And the checkbox will show all the time. I tried this on my child themes function.php file, but it’s not working! 🙁
add_filter(‘is_valid_payment_through_wallet’, ‘__return_false’);
add_filter(‘woo_wallet_partial_payment_amount’, ‘woo_wallet_partial_payment_amount_callback’, 10);
function woo_wallet_partial_payment_amount_callback($amount) {
if (sizeof(wc()->cart->get_cart()) > 0) {
$cart_total = get_woowallet_cart_total();
$partial_payment_amount = ($cart_total * 30) / 100;
if ($amount >= $partial_payment_amount) {
$amount = $partial_payment_amount;
}
}
return $amount;
}