Use the woocommerce_bookings_csv_importer_args filter to change the arguments passed into the importer constructor. This is useful when the default importer class is still correct, but one runtime option needs adjustment. The snippet below increases the number of parsed lines for the default importer class while leaving arguments unchanged for other importer classes.
add_filter(
'woocommerce_bookings_csv_importer_args',
function ( array $args, string $importer_class ): array {
if ( WC_Bookings_Importer::class === $importer_class ) {
// Process 50 rows per batch instead of the default 30.
$args['lines'] = 50;
}
return $args;
},
10,
2
);