Hi All,
Just wondering if anyone has some insight into how to display an ACF in the woocommerce email confirmation.
I have tried several things but nothing seems to work.
Any help would be hugely appreciated.
I created a new field – order number
Condition: record type – equal – order
And pasted the following code into the file functions.php
//Order number
add_action( 'woocommerce_email_before_order_table', 'alx_add_content_specific_email', 20, 4 );
function alx_add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
if ( $email->id == 'customer_completed_order' )
if (get_field('alx_sdek', $order->id)) {
echo '<h2 class="email-upsell-title">Информация об отправлении:</h2><p class="email-upsell-p">Номер отправления: <strong>';
the_field('alx_sdek', $order->id);
echo '</strong> отследить можно на сайте <a href="https://www.cdek.ru/track.html">СДЭК</a>.</p>';
}
}