【问题标题】:Woocommerce change customer name orderWoocommerce 更改客户名称订单
【发布时间】:2018-07-31 08:28:36
【问题描述】:

希望有人能帮帮我!

我想在仪表板的 woocommerce 中更改客户名称订单。

我使用此代码,它工作正常,但帐单和运输订单名称的顺序仍然错误:

    function wp_update_display_name ( $user_login, $user ) {
      $user_info = get_userdata($user->ID);
      $first_name = $user_info->first_name;
      $last_name = $user_info->last_name;

      wp_update_user(array('ID' => $user->ID, 'display_name' => $last_name . ' '. $first_name));
}

add_action('wp_login', 'wp_update_display_name', PHP_INT_MAX, 2);

我使用通过 API 连接到 Woo 的计费软件。计费软件中的姓名顺序也是错误的。

编辑:当前状态是 [firstname] [lastname]。我住在匈牙利,订单是 [姓] [名字]。

请帮帮我, 本杰明

【问题讨论】:

  • 你所说的“命名顺序”是什么意思,它现在是什么样子,你期望它是什么样子?
  • 当前状态为 [firstname] [lastname]。我住在匈牙利,订单是 [姓] [名字]。我会编辑帖子,谢谢:)
  • 类似的方法将适用于亚洲的名称

标签: wordpress sorting woocommerce localization internationalization


【解决方案1】:

我有同样的问题。首先我找到了this link,但仅更改优先级并没有帮助。经过一番检查,这就是我所做的:

$checkout_fields['billing']['billing_first_name']['priority'] = 20;  
$checkout_fields['billing']['billing_first_name']['class'][0] = 'form-row-last';
$checkout_fields['billing']['billing_last_name']['priority'] = 10;
$checkout_fields['billing']['billing_last_name']['class'][0] = 'form-row-first';

对我来说效果很好!

【讨论】:

    猜你喜欢
    • 2020-12-24
    • 2019-10-09
    • 1970-01-01
    • 2020-10-03
    • 2022-01-14
    • 2021-12-12
    • 1970-01-01
    • 2017-05-24
    相关资源
    最近更新 更多