I have added to custom fields on the checkout page using YITH checkout Manager billing_customfield1 and billing_customfield2. I need to show this fields on the email sent by woocommerce.
this is the way , the fields from checkout are being displayed on the email template:
<?php if ( $order->get_billing_first_name() ) : ?>
<br/><?php echo '<b>Nombre: </b>'.esc_html( $order->get_billing_first_name().' '.$order->get_billing_last_name() ); ?>
<?php endif; ?>
<?php if ( $order->get_billing_phone() ) : ?>
<br/><?php echo '<b>Teléfono: </b>'.esc_html( $order->get_billing_phone() ); ?>
<?php endif; ?>
<?php if ( $order->get_billing_company() ) : ?>
<br/><?php echo '<b>Nombre de la empresa: </b>'.esc_html( $order->get_billing_company() ); ?>
<?php endif; ?>
<?php if ( $order->get_billing_address_1() ) : ?>
<br/><?php echo '<b>Dirección: </b>'.esc_html( $order->get_billing_address_1() ); ?>
<?php endif; ?>
<?php if ( $order->get_billing_address_2() ) : ?>
<br/><?php echo '<b>Dirección 2: </b>'.esc_html( $order->get_billing_address_2() ); ?>
<?php endif; ?>
<?php if ( $order->get_billing_city() ) : ?>
<br/><?php echo '<b>Ciudad: </b>'.esc_html( $order->get_billing_city() ); ?>
<?php endif; ?>
I need to show the new 2 custom fields as well but there's no method for
$order->get_customfield1()