Maybe someone knows, how to add a condition: if the payment amount is less than 3000 - certain payment method is hidden?
For example, there are 2 payment methods:
- cash
- online payment
If the amount is less than 3000, the "cash" method is hidden.
As far as I understand, I need to get the payment gateway ID, and then apply the snippet:
add_filter( 'woocommerce_available_payment_gateways', 'custom_paypal_disable_manager' );
function custom_paypal_disable_manager( $available_gateways ) {
if ( $total_amount < 3000 ) {
unset( $available_gateways['ID payment gateway'] );
return $available_gateways;
}
But I don't know how to get the payment gateway ID (there are several payment methods and they are all implemented by different plugins). Perhaps there is a way to get all IDs of payment gateways in a list.
I would be grateful for any information.