[ad_1]
You can use the filters provided by WooCommerce to accomplish what you want.
Example:
add_filter('woocommerce_available_payment_gateways', function($gateways){
if(is_checkout() && WC()->cart){
foreach(WC()->cart->get_cart() as $values){
if(isset($values['data'])){
if($values['data']->get_id() === 79){
unset($gateways['stripe_ach']);
break;
}
}
}
}
return $gateways;
});You will need to replace “79” with your own product ID.
