Hi Misty,
Try following PHP snippet do disable pre bank transfer gateway for expect one specific invoice item.
/**
* Filter payment gateways on checkout page.
*/
function wpi_snippet_200320_payment_gateways_on_cart( $gateways = array() ) {
$invoice = wpinv_get_invoice( 0, true );
if ( ! empty( $invoice ) && ( $items = $invoice->get_items() ) ) {
foreach ( $items as $key => $item ) {
if ( ! empty( $item ) && ! empty( $item['id'] ) && $item['id'] == 84 ) { // 84 is Item ID from Invoicing > Items > ID
} else {
if ( isset( $gateways['bank_transfer'] ) ) {
unset( $gateways['bank_transfer'] ); // Unset gateway
}
}
}
}
return $gateways;
}
add_filter( 'wpinv_payment_gateways_on_cart', 'wpi_snippet_200320_payment_gateways_on_cart', 20, 1 );
Thanks,
Kiran