Php 如何从感谢页面中的订单访问自定义字段
我在订单中创建了很多自定义字段,现在我正在尝试在“谢谢”页面上完成订单后访问这些字段 我已经看到了反应,但对我来说不起作用。我做一个var转储来查看Php 如何从感谢页面中的订单访问自定义字段,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,我在订单中创建了很多自定义字段,现在我正在尝试在“谢谢”页面上完成订单后访问这些字段 我已经看到了反应,但对我来说不起作用。我做一个var转储来查看$order->order\u custom\u字段的内部内容,但我只得到字符串(0)“ 我正在编辑文件order-details-customer.php如何访问自定义字段 下面是我创建的自定义字段的示例 woocommerce_form_field( 'destination_state', array( 'typ
$order->order\u custom\u字段的内部内容
,但我只得到字符串(0)“
我正在编辑文件order-details-customer.php如何访问自定义字段
下面是我创建的自定义字段的示例
woocommerce_form_field( 'destination_state', array(
'type' => 'text',
'class' => array('destination_state form-row-first'),
'label' => __('State'),
'required' => true,
), $checkout->get_value( 'destination_state' ));
经过一番探索和逻辑思考,我发现这很容易
echo '<p>' . get_post_meta( $order->id, 'Date Collection', true ) . '</p>';
echo''。获取发布元($order->id,'datecollection',true)。' ",;