Plugin Contributor
Ewout
(@pomegranate)
Hi Ederer,
Here’s what you need:
<?php echo get_post_meta($wpo_wcpdf->export->order->id,'_billing_last_name',true); ?>
also see this thread:
https://ww.wp.xz.cn/support/topic/get-billing-address-info-separately?replies=6
Thread Starter
babr
(@ederer)
Oh that’s perfekt! Works very well!
Is it also possible to add a custom field from the billing form?
For example the salutation?
I must just change the ‘_billing_last_name’ with the id from my custom field, isn’t it?
Thank you for your quick answer!
King regards,
Ederer
Plugin Contributor
Ewout
(@pomegranate)
See the FAQ! for custom fields, you can use:
<?php $wpo_wcpdf->custom_field('custom_fieldname', 'Custom field:'); ?>
that also works for the last name by the way (just leave the caption/title empty):
<?php $wpo_wcpdf->custom_field('_billing_last_name', ''); ?>
Thread Starter
babr
(@ederer)
That’s nice!
but I’ve still two problems…
1. I’d like to show the order_comments on another place as in the shipping_address. I used the following:
<?php echo get_post_meta($wpo_wcpdf->export->order->id,'_order_comments',true); ?>
but it doesn’t appear.
2. I wanted to show the country full displayed and only if it isn’t the home-country. I tried to go on with your advice on this post:
https://ww.wp.xz.cn/support/topic/get-billing-address-info-separately?replies=6
but it destroys my PDF.
Could you help me again please?
Thank you so much for your support!
Plugin Contributor
Ewout
(@pomegranate)
Hello Ederer,
1. Order comments are not meta data but actual comments. Try this:
https://ww.wp.xz.cn/support/topic/how-to-add-customerorder-notes?replies=7
2. There was an error in the code (missing square bracket in countries->countries[ $billing_country ]) sorry about that! I corrected it in that same thread.
Ewout