Title: ACF Custom Fields
Last modified: March 31, 2022

---

# ACF Custom Fields

 *  Resolved [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/)
 * Hello,
 * I’ve been trying to add an ACF field to my invoices and for unknown reasons I
   can not get it to work. I’ve tried using the following code without much success.
   The ACF field meta is customer_no. I’ve used USER_customer_no and _customer_no
   and still getting a blank display. Any assistance will be appreciated.
 *     ```
       /* Add Account Number to Invoice */
       add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_customer_no', 10, 2 );
       function wpo_wcpdf_customer_no ($template_type, $order) {
           if ($template_type == 'invoice') {
               ?>
               <tr class="customer-no">
                   <th>Account No: </th>
                   <td><?php echo $order->get_meta('customer_no'); ?></td>
               </tr>
               <?php
           }
       }
       ```
   

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Contributor [Darren Peyou](https://wordpress.org/support/users/dpeyou/)
 * (@dpeyou)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15515275)
 * Hi [@alortiz3](https://wordpress.org/support/users/alortiz3/),
 * Could you show us a screenshot of this custom field from the ACF settings? For
   that you could use a free service like imgbb.com.
 * Looking at [this thread](https://wordpress.org/support/topic/issue-with-acf-field/)
   regarding ACF, it sounds to me like you should be using `the_field()`, like this:
 *     ```
       the_field( 'customer_no', $order->get_id() )
       ```
   
 * Instead of using `$order->get_meta()`
 * [ACF documentation — the_field()](https://www.advancedcustomfields.com/resources/the_field/)
 *  Thread Starter [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15515303)
 * Thank you for your prompt response. Tried with the suggested code, got the same
   result.
    Attached is the screenshot that you requested. [https://ibb.co/yYXKrKr](https://ibb.co/yYXKrKr)
 *  Plugin Contributor [Darren Peyou](https://wordpress.org/support/users/dpeyou/)
 * (@dpeyou)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15515385)
 * [@alortiz3](https://wordpress.org/support/users/alortiz3/),
 * Could you share a screenshot of the field & its value from the **Edit-Order**
   screen? Like this:
    ⌊custom-Field-ACF⌉
 * From the settings, is the field Active?
 * You also mentioned that “the result is the same”, but what is the result? Is 
   the “Account No:” text visible? Completely blank? Error message?
 *  Thread Starter [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15515402)
 * Here are the screenshots. One shows the field and the value, the other shows 
   the result in the Invoice. [https://ibb.co/7X16csT](https://ibb.co/7X16csT)
    
   [https://ibb.co/PMQ4qv8](https://ibb.co/PMQ4qv8)
 *  Plugin Contributor [Darren Peyou](https://wordpress.org/support/users/dpeyou/)
 * (@dpeyou)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15515444)
 * [@alortiz3](https://wordpress.org/support/users/alortiz3/),
 * For me, this works both with the original `$order->get_meta('meta_key_here')`&
   the other function I sent to you, which leads me to believe that the field is
   empty in the order.
 * I expected your screenshot of the Custom Field from the Edit-Order page to look
   like mine, but it’s quite different – so I’m wondering if you’re on the correct
   screen.
 * If you install the [WC Store Toolkit plugin](https://wordpress.org/plugins/woocommerce-store-toolkit/),
   you’ll be able to see all the meta-data in your order under Order Post Meta, 
   like so (_juju):
 * ⌊Screenshot-2022-03-31-14-48-56⌉⌊Screenshot-2022-03-31-14-48-56⌉
    ⌊Screenshot-
   2022-03-31-14-49-34⌉
 * This will help us confirm whether or not the ‘customer_no’ field is present (&
   populated) in the order.
    -  This reply was modified 4 years, 2 months ago by [Darren Peyou](https://wordpress.org/support/users/dpeyou/).
    -  This reply was modified 4 years, 2 months ago by [Darren Peyou](https://wordpress.org/support/users/dpeyou/).
      Reason: additional sentence at end
 *  Thread Starter [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15515509)
 * I just tried a newer order to see if there are any differences. As you can see
   on the attached screen the Account Number is present, but it does not show in
   the invoice. We do not include the account number in the order details which 
   why you don’t see it in the edit orders screen. The account number is part of
   the user’s profile. [https://ibb.co/JyTjpFL](https://ibb.co/JyTjpFL)
 *  Thread Starter [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15529255)
 * The field does not show up in the Order Post Meta area. Any other suggestions?
 *  Plugin Contributor [Darren Peyou](https://wordpress.org/support/users/dpeyou/)
 * (@dpeyou)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15529816)
 * [@alortiz3](https://wordpress.org/support/users/alortiz3/),
 * I’m afraid that means the field isn’t present in the order. Since we are dealing
   with the ACF plugin, from the settings, could you show us a screenshot of the**
   Location** block of this field? It should be right under the items in the 1st
   screenshot you shared.
 * ![ACFLocation](https://i0.wp.com/i.ibb.co/fMnLdQF/ACFLocation.png?ssl=1)
 *  Thread Starter [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15529862)
 * Here’s the screenshot that you requested: [https://ibb.co/Qkq37CQ](https://ibb.co/Qkq37CQ)
 * Thanks!
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15531627)
 * `$order->get_meta()` is for pulling order meta, but it looks like your ACF field
   is for User meta. More information about displaying user meta is in our documentation
   here: [https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-user-data/](https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-user-data/)
 *  Thread Starter [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * (@alortiz3)
 * alortiz3
 * [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15532852)
 * This has been solved using the suggested code. Thank you very much!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘ACF Custom Fields’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [display custom field](https://wordpress.org/support/topic-tag/display-custom-field/)

 * 11 replies
 * 3 participants
 * Last reply from: [alortiz3](https://wordpress.org/support/users/alortiz3/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/acf-custom-fields/#post-15532852)
 * Status: resolved