advanced custom fields - ACF in WooCommerce mail template

I am usingplugin in WooCommerce and I have set a custom field named "sub_domain".I am trying to display th

I am using / plugin in WooCommerce and I have set a custom field named "sub_domain". I am trying to display the value of this custom field in the Woocommerce template woocommerce/emails/customer-completed-order.php After some research on the internet i found and used that code in to the woocommerce/emails/customer-completed-order.php but it isn't working as like i expected:


<?php 
// Get the $order ID (WooCommerce version compatibility) 
if ( version_compare( WC_VERSION, '3.0', '<' ) ) { 
$order_id = int_val( $order->id ); // Older than 3.0 
} else { $order_id = int_val( $order->get_id() ); // 3.0+ 
} $domain = get_field('sub_domain', $order_id );
if( $domain ){ echo '<p>' . $domain . '</p>'; } 
?>

the result is my site gets down whenever i try to make a new order (from backend). Do you have any idea what's wrong? Thanks in advance for any help!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745198921a4616228.html

相关推荐

  • advanced custom fields - ACF in WooCommerce mail template

    I am usingplugin in WooCommerce and I have set a custom field named "sub_domain".I am trying to display th

    6小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信