I added some fields in the WooCommerce orders page using Advanced Custom Fields (ACF) plugin to work as tracking information. Essentially I want the admin to fill out this info and it will be sent in the completed email to the customer once their order has been marked complete.
Does anyone know how I can get the ACF values?
Below is the code inside my customer-completed-order.php file. Obviously it's not working.
$order = new WC_Order($order_id);
//set tracking variables from advanced custom fields plugin
$tracking = get_field('tracking-code', $order);
$carrier = get_field('carrier-name', $order);
$date = get_field('pickup_date', $order);
<p>Your order has been picked up by <?php echo $carrier; ?> on <?php echo $date; ?>. Your tracking code is <?php echo $tracking; ?>.</p>