我尝试在 woocommerce_before_checkout_form 操作的结帐页面上显示订单 ID,但我没有任何价值
function action_woocommerce_before_checkout_form( $checkout ) {
var_dump(WC()->order->get_customer_id);
echo'
<div class="right-side">
<div class="logo">';
echo'
</div>
<div class="order-number"></div>
</div>';
};
// add the action
add_action( 'woocommerce_before_checkout_form', 'action_woocommerce_before_checkout_form', 10, 1 );
任何人有想法得到订单ID?