Use the woocommerce_bookings_csv_importer_class filter when a customization needs to replace the CSV importer with a class that extends WC_Bookings_Importer. This is a deeper extension point than changing mappings or batch size, so the replacement class should preserve the importer contract. The snippet below returns a custom importer class only when that class is available, otherwise it leaves the default importer in place.
add_filter(
'woocommerce_bookings_csv_importer_class',
function ( string $importer_class ): string {
if ( class_exists( My_Custom_Bookings_Importer::class ) ) {
return My_Custom_Bookings_Importer::class;
}
return $importer_class;
}
);