admin管理员组文章数量:1415139
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!
本文标签: advanced custom fieldsACF in WooCommerce mail template
版权声明:本文标题:advanced custom fields - ACF in WooCommerce mail template 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745198920a2647275.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论