Hello Michal,
You can just type “NIP (do factury VAT):” in front of the code, it’s as simple as that :o)
If you only want to display the label when the field data is present, you can use a slightly altered code snippet:
<?php
$nip = get_post_meta($wpo_wcpdf->export->order->id,'NIP (do fakury VAT)',true);
if (isset($nip)) {
echo 'NIP (do factury VAT): ' . $nip;
}
?>
I disagree with you that the function is NOT AVAILABLE in the plugin. I am not asking you to modify any core files, I have created a templating system that allows to you create a custom template completely to your liking. This is quite different from adding functionality to the plugin.
You don’t need programming skills to add the custom fields code, just some basic knowledge of HTML and a text editor. You type text like you normally would in a document, and add the code snippets where you want the custom fields to appear.
What you propose is very complex to implement, programming wise, because there are many possible locations and formatting for these custom fields in the invoice. Moreover, it would impede the flexibility that the custom templating system currenly offers, because there would be much more code in the template. This is a choice I made, the template flexibility is a very important aspect of the plugin that also sets it apart from other PDF plugins on the market.
That said, I agree with you that it would be nice to be able to add a custom field as easy as you suggest. I am tinkering with the idea to create a template editor that you can install besides the main plugin, and I think this would meet your wish to alter the contents of the invoices and packing slips more easily, while still maintaining the basic template flexibility of the plugin.