Override plugin function to show invoices even if not logged in

Try to remove the plugin function from the filter.

Are you sure the plugin function and the filter have the same name!

*You will need to know the priority that the plugin function is using to use it in remove_filter, I will assume It’s the default (10).

remove_filter( 'print_document_action', 'print_document_action', 10 );

Then add your function to the filter.

add_filter('print_document_action', 'showInvoices', $priority = 9999, $args = 1);