Hello @jwbdv
This can be achieved with a simple Code snippet that can be used for any payment gateway in PayPal Payments:
add_filter('woocommerce_available_payment_gateways', function($gateways) {
$maximumOrderTotal = 100; // Maximum allowed order total for displaying the gateway
$shouldHideGatewayForHighTotal = function($orderTotal) use ($maximumOrderTotal) {
return $orderTotal > $maximumOrderTotal;
};
if (WC()->cart && isset($gateways['ppcp-pay-upon-invoice-gatewa'])) {
if ($shouldHideGatewayForHighTotal(WC()->cart->total)) {
unset($gateways['ppcp-pay-upon-invoice-gatewa']);
}
}
return $gateways;
});
Let us know if this meets your requirements.
Kind regards,
Krystian
Hello @jwbdv
Since we have not received any further communication from you, we are assuming that your issue has been resolved.
Therefore, we mark this thread as resolved. If you still have any questions or if a new problem arises, don’t hesitate to open a new thread or reply to this one. We are here to help at any time.
Kind regards,
Krystian