【发布时间】:2017-08-17 09:16:50
【问题描述】:
在数据库中,我们有 metauser 表,其中包含:first_name 和 last_name 字段
这些是默认的 Wordpress 名字和姓氏。
我们还有:billing_first_name 和 billing_last_name。
现在,当用户填写帐单并进行结帐流程时, Woocommerce 使用账单名称字段中的新值更新这两个字段 (默认)。
我已经尝试了很多使用动作的东西,例如:
woocommerce_before_checkout_billing_form
或
woocommerce_after_checkout_billing_form
还尝试使用以下内容更新元:
update_user_meta()
但它不起作用。
我希望它不会覆盖默认的 first_name 和 last_name,
但仅在 billing_first_name 和 billing_last_name 中保留新值
我觉得默认流程是这样的
https://gist.github.com/claudiosanches/ae9a8b496c431bec661b69ef73f1a087
请问有什么帮助吗?
【问题讨论】:
标签: php wordpress woocommerce checkout user-data