Can I Set a Minimum for One WooCommerce Payment Method?
How to Set a WooCommerce Method Minimum
WooCommerce provides a filter (woocommerce_available_payment_gateways) specifically for conditionally showing or hiding gateways based on any logic, including the current cart total. A small snippet checking WC()->cart->get_total() against a threshold and unsetting the specific gateway when the condition isn't met is the standard approach, and several "conditional payment gateways" plugins package this exact logic with a settings UI instead of custom code.
add_filter( 'woocommerce_available_payment_gateways', function( $gateways ) {
if ( isset( $gateways['bnpl_gateway'] ) && WC()->cart && WC()->cart->get_total( 'edit' ) < 50 ) {
unset( $gateways['bnpl_gateway'] );
}
return $gateways;
} );
Things Worth Getting Right
- Use the cart total in the correct format (a raw number via
get_total( 'edit' ), not the formatted display string), since comparing against a formatted price string with currency symbols will silently fail. - Decide whether the threshold applies to the subtotal or the full total including tax and shipping, since this changes the comparison meaningfully for some order combinations.
- Test on both the cart page and checkout page, since some themes/page builders render available gateways slightly differently, and the filter needs to apply consistently across both.
- Consider messaging for the customer, since a payment method silently disappearing below a threshold can be confusing without some explanation (a note near the payment section, for instance).
Implementing It Properly
- Confirm the exact threshold and which gateway(s) it applies to before writing or configuring anything.
- Use the
woocommerce_available_payment_gatewaysfilter (custom snippet or plugin) rather than trying to hide the option purely with CSS, which wouldn't actually prevent its use. - Add a brief note near checkout explaining the condition, so customers aren't confused by a missing option.
Need this built and tested properly for a specific gateway setup? See custom WooCommerce development.