Is there a way or filter to disable selective payment methods if cart quantity increase more than "X number of items" example "15"?
I know we can limit max number of quantity before adding to cart but I want to disable some payment methods only.
Thanks
You can specify in the payment condition that if the basket number exceeds your chosen amount (e.g., 15), then the payment method will not be displayed in the auction.
You can use a custom function hooked in
woocommerce_available_payment_gateways
filter hook. You will have to set inside it your quantity limit and your payment methods slugs.Here is that code:
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and works on WooCommerce version 2.6 and 3+.