Woocmmerce order complete custom field
-
Hi,
Is there someone who use ACF with Woocommerce ?
I created a custom field to send the Additional Info to our clients email once the order is completed.
Here is the code:
add_action (‘woocommerce_order_details_after_order_table’, ‘acf_additionalinfo’, 20);
function acf_additionalinfo( $order ) {
if (get_field(‘additionalinfo’, $order->id)) { // Only show if field is filled
?>
DHL: <?php the_field(‘additionalinfo’, $order->id); ?><?php
}
}
It work well but it seems that I have to fill in the field, save the page, then I have to change the order to complete and resave the page.
Else, the additiona linfo will not be included in the order confirmation email.
Here is a topic about this: https://support.advancedcustomfields.com/forums/topic/showing-acf-field-on-woocommerce-order-page/
I am starting to think that it is a limitation in the WC filter.
- The topic ‘Woocmmerce order complete custom field’ is closed to new replies.