Home › Forums › Front-end Issues › ACF in Woocommerce Email › Reply To: ACF in Woocommerce Email
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>';
}
}
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.