Home › Forums › General Issues › Add Field to invoice attachment › Reply To: Add Field to invoice attachment
HI @yett
I think you would need to add the field to the order not the product.
You then need to add the code to the emails:
/**
* Add a custom field (in an order) to the emails
*/
add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 );
function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
$fields['Begindatum'] = array(
'label' => __( 'Begin Datum' ),
'value' => get_post_meta( $order->id, 'Begindatum', true ),
);
return $fields;
}
If you’re using a plugin for the invoices, you may need to check if they have any hooks
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.