小编Ale*_*sov的帖子

如何在 WooCommerce 中更改帐单地址字段标签

在我的设计中,我有非标准的计费字段标签和标记。例如“Town / City *”应该是“Province *”。

我使用过 WOO 文档和 filter woocommerce_billing_fields。它适用于类名、占位符、创建新字段。但我无法触及已更改的标签。

$out_arr['billing_city']['class'][0] = 'form-row-first';
$out_arr['billing_city']['label'] = __('Province', 'woocommerce');
$out_arr['billing_postcode']['label'] = __('Zipcode', 'woocommerce');
Run Code Online (Sandbox Code Playgroud)

并使用var_dump$out_arr数组显示正确的标签

["billing_city"]=>
array(4) {
["label"]=>
string(8) "Province"
["required"]=>
bool(true)
["class"]=>
array(2) {
  [0]=>
  string(14) "form-row-first"
  [1]=>
  string(13) "address-field"
}
["autocomplete"]=>
string(14) "address-level2"
}
Run Code Online (Sandbox Code Playgroud)

但我在前端仍然有旧标签。请问有什么建议吗?

php wordpress checkout custom-fields woocommerce

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

checkout ×1

custom-fields ×1

php ×1

woocommerce ×1

wordpress ×1