Thanks for providing more details, @thijsbrouwer:
Try the following code snippet to customize that text when the order has zero tax:
/**
* PDF Invoices & Packing Slips for WooCommerce:
* Customize texts on the PDF documents (gettext)
*/
add_filter( 'wpo_wcpdf_html_filters', function( $filters, $document ) {
// If order tax is equal to zero...
if ( $document->order->get_total_tax() == 0 ) {
// ...customize the VAT sentence
$filters[] = array( 'gettext', 'wpo_wcpdf_customize_string_translation', 999, 3 );
}
return $filters;
}, 10, 2 );
function wpo_wcpdf_customize_string_translation( $translation, $text, $domain ) {
if ( $domain == 'woocommerce' ) { // Change this for the actual plugin slug
switch ( $text ) {
// Repeat as many cases as strings you want to translate
case '(includes %s)':
$translation = '(no VAT applicable)';
break;
}
}
return $translation;
}
If you haven’t worked with code snippets (actions/filters) or functions.php
before, read this guide: How to use filters