Custom Checkout Fields on Invoice
-
Hello,
I have followed all the examples in your other support threads, and am still coming up blank. I’m trying to incorporate custom fields into my Invoices from Checkout Field Manager for WC (not to be confused with Woocommerce Checkout Manager, different plugin). They’ve assured me that their custom fields are titled exactly what I dictate the name is on their backend, for example ‘this_field’.
So far I’ve done the following:
– Created custom template
– Added native WooCommerce fields to the template (e-mail and phone #)and for the custom fields, I have the following code added below the Payment Method code in the invoice template (including the payment method lines below for clarification on location):
<span class="order-payment-label"><?php _e( 'Payment Method:', 'wpo_wcpdf' ); ?></span> <span class="order-payment"><?php $wpo_wcpdf->payment_method(); ?></span><br /> <?php $ffl_dealer = get_post_meta($wpo_wcpdf->export->order->id,'FFL Dealer',true); if (isset($ffl_dealer)) { echo $ffl_dealer; } ?> <?php $order_notes = get_post_meta($wpo_wcpdf->export->order->id,'Order Notes',true); if (isset($order_notes)) { echo $order_notes; } ?> <?php $wpo_wcpdf->custom_field('FFL Dealer', 'FFL Dealer:', true); ?>
The last line I added to see what it did, and all it makes is an empty field show up on my invoices that says “FFL Dealer:”. Other than that, no change is made at all to the invoice.
As you can see I’m just trying to pull two custom fields, one called ffl_dealer and the other called order_notes. I feel like this is an extremely easy fix and I’m just doing something stupid. Can you please point me in the right direction?
https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/
- The topic ‘Custom Checkout Fields on Invoice’ is closed to new replies.