I was now able to isolate the problem. I have the following code in my template in invoice.php to show extra fields:
<?php
$settings_general = get_option( 'wpo_wcpdf_settings_general' );
$document = wcpdf_get_document( $template_type, $order );
$items = $order->get_items();
$custom_field_1 = '';
$custom_field_2 = '';
$custom_field_3 = '';
foreach ( $items as $item ) {
$product_id1 = $item['product_id'];
if ( has_term( 'werbemittel', 'product_cat', $product_id1 ) ) {
$custom_field_1 = '<p>' . $this->get_settings_text( 'extra_1' ) . '</p>';
continue;
}
}
foreach ( $items as $item ) {
$product_id = $item['product_id'];
if ( has_term( 'buchung', 'product_cat', $product_id ) ) {
$custom_field_2 = '<p>' . $this->get_settings_text( 'extra_2' ) . '</p>';
continue;
}
}
foreach ( $items as $item ) {
$product_id = $item['product_id'];
if ( has_term( 'mitgliedsbeitrag', 'product_cat', $product_id ) ) {
$custom_field_3 = '<p>' . $this->get_settings_text( 'extra_3' ) . '</p>';
break;
}
}
?>
These lines come before <table class=”head container”>. That worked for years, but not anymore. Can you please tell me how to properly display an additional field.