【发布时间】:2021-01-22 18:51:56
【问题描述】:
我正在尝试在结帐表单的状态字段下直接添加注释:
这样的:
“如果您需要在北卡罗来纳州或南卡罗来纳州以外邮寄药物,或者您不是客户,请致电”。
我尝试了各种方法来实现这一点,但似乎都没有奏效。我尝试过使用 CSS:
#billing_state:after {
content: "If you need medication mailed outside of NC or SC, or you are not a client, please call";
font-size: 14px;
color: red;
}
我也尝试将其添加到 functions.php 文件中:
add_filter('woocommerce_form_field_text', function ($field, $key, $args, $value) {
if ($key === 'billing_state') {
$field .= 'If you need medication mailed outside of NC or SC, or you are not a client, please
call';
}
return $field;
}, 10, 4);
但是这些方法都不起作用。这是我要定位的 state 字段的代码:
【问题讨论】:
标签: php wordpress woocommerce woocommerce-theming woocommerce-checkout-fields