In Woocommerce, I need to hide some payments gateway depending on type of variation. I tried:
add_filter( 'woocommerce_available_payment_gateways','eikon_regional_payments', 10, 1 );
function eikon_regional_payments( $array_payments ) {
if( WC()->product->get_variation_attributes() == 'regional' )
unset($array_payments['woo-mercado-pago-basic']);
return $array_payments;
}
But it does not works: