Hello,
We created 3 ACF fields in the “Users” location.
We’d like the values included in the 3 fields to be included when we run an orders export.
When we run an Orders export, we do have the option to select these 3 ACF fields, but they are completely empty and show no values.
We need to know how to map these fields that exist at the user level so that when we run an orders export, they show the values that are in these fields for the user that placed the order in the orders export.
How do we go about doing this?
Thank you,
A
What are you using to do the export?
What you are going to have to do is to build a function to process and return what you want added to the export. You’ll need to pass the user ID to the function and then use that to get the ACF fields from the user.
WP All Export Documentation
Thanks, John. I was able to figure out how to pull from the user level using the following function:
function my_get_customernumber( $uid ) {
return get_field( ‘CustomerNo’, ‘user_’ . $uid );
But now I’m struggling to figure out how to pull another field from the product level. Below is what I tried but it’s not working.
function my_get_brand( $uid ) {
return get_field( ‘brand’, ‘product_’ . $product_id );
I’m assuming what I have in bold above may need to be changed to something else. Any idea what I’m doing wrong?
get_field( 'brand', $product_id );