【发布时间】:2019-04-25 07:06:12
【问题描述】:
我已使用 YITH 结帐管理器 billing_customfield1 和 billing_customfield2 添加到结帐页面上的自定义字段。 我需要在 woocommerce 发送的电子邮件中显示此字段。
就是这样,结帐的字段显示在电子邮件模板上:
<?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; ?>
我还需要显示新的 2 个自定义字段,但没有方法
$order->get_customfield1()
【问题讨论】:
标签: php wordpress woocommerce custom-fields orders