Created
December 4, 2019 16:02
-
-
Save malsubrata/c3140fc7b7b9eb909346ec3e14f554f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('is_enable_wallet_partial_payment', '__return_true'); | |
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 * 20) / 100; | |
if ($amount >= $partial_payment_amount) { | |
$amount = $partial_payment_amount; | |
} | |
} | |
return $amount; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment