[英]Woocommerce Checkout Errors Edit
當然可以,只需將過濾器添加到鈎子woocommerce_checkout_required_field_notice
。
function filter_woocommerce_checkout_required_field_notice( $sprintf, $field_label ) {
$my_custom_notice = '' . $field_label . ' and my custom notice!';
return sprintf( __( '%s is a required field.', 'woocommerce' ), $my_custom_notice );
}
add_filter( 'woocommerce_checkout_required_field_notice', 'filter_woocommerce_checkout_required_field_notice', 10, 2 );
嘗試將錯誤框的內容更改為“需要帶 * 的字段”之類的內容。
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#Id_of_Error_Container").html('<p class="red">Fields with * are required</p>');
});
</script>
將此添加到 footer.php 並使用錯誤框的 div id 更改 #Id_of_Error_Container。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.