Home › Forums › General Issues › ACF refresh button › Reply To: ACF refresh button
Hi,
I am trying to update a custom field ( in the woocommerce order page). Once the field is saved, I then change the status email to complete and send the number into the order completion email. using this code:
// define the woocommerce_email_before_order_table callback
function action_woocommerce_email_before_order_table( $order, $sent_to_admin, $plain_text, $email ) {
if (get_field('ACFFIELDNAME', $order->get_id())) { // Only show if field is filled
?>
<h3>Your number: <?php the_field('ACFFIELDNAME', $order->get_id()); ?></h3>
<?php
}
};
// add the action
add_action('woocommerce_email_before_order_table', 'action_woocommerce_email_before_order_table', 10, 4 );
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.