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
评论列表(0条)