【问题标题】:How to avoid users from editing some billing address fields in WooCommerce? [duplicate]如何避免用户在 WooCommerce 中编辑某些帐单地址字段? [复制]
【发布时间】:2021-03-13 22:48:29
【问题描述】:

我正在使用Disable or make read only the fields from edit account pages in Woocommerce 2nd code sn-p,将我的帐户上的账单字段名、姓和电子邮件设为只读 > 编辑账单地址。 此代码适用于帐户页面。

我可以在结帐帐单字段中使用相同的代码吗?

我应该修改什么?

【问题讨论】:

  • 在原始链接线程中添加了一个更新......所以要在结帐页面上也启用它,只需删除 if( is_account_page() ){return $billing_fields; 之前的右括号 }

标签: php wordpress woocommerce checkout account


【解决方案1】:

也许会改变:

if( is_user_logged_in() && is_account_page() ){

收件人:

if ( is_user_logged_in() && ( is_account_page() || is_checkout() ) ) {

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-01
    • 2019-01-28
    • 2022-01-20
    • 1970-01-01
    • 2021-06-12
    • 2016-12-08
    • 1970-01-01
    相关资源
    最近更新 更多