我试图找到woocommerce方法,这将允许我设置结算和/或运送名字。woocommerce设置结算名第
客户类将允许我设置一些字段,但不是first_name。任何人都知道是否存在方法,或者是否需要直接使用billing_first_name
更新wp_usermeta表。
这里是什么行不通的例子:
global $woocommerce;
$user_first_name = get_user_meta($user_id, 'first_name', true);
if(!empty($woocommerce->customer->get_billing_first_name())) {
$woocommerce->customer->set_billing_first_name($user_first_name); // a set_billing_first_name method doesn't exist
}
欢迎使用stackoverflow!如果您发布了一些代码,显示您现在正在做什么,以及/或者您未来希望如何做,这将会有很大帮助。究竟是什么问题? – davidkonrad
谢谢你让我知道 – user8582