返信先: 別の発送先の指定について

フォーラム テンプレート(テーマ) 別の発送先の指定について 返信先: 別の発送先の指定について

#81167
romen
参加者

自身の方で、少し進展がありました。

add_filter(‘usces_filter_delivery_check’, ‘my_filter_delivery_check2’, 10);
function my_filter_delivery_check2($mes) {
$mes = ”;
if ( isset($_POST[‘delivery’][‘delivery_flag’]) && $_POST[‘delivery’][‘delivery_flag’] == 1 ) {
if ( WCUtils::is_blank($_POST[“delivery”][“name1”]) )
$mes .= “届け先名を入力してください<br />”;
// if ( trim($_POST[“delivery”][“name3”]) == “” && USCES_JP )
// $mes .= __(‘Invalid CANNAT pretend.’, ‘usces’) . “<br />”;
/*if ( WCUtils::is_blank($_POST[“delivery”][“zipcode”]) )
$mes .= __(‘postal code is not correct’, ‘usces’) . “<br />”;
if ( $_POST[“delivery”][“pref”] == __(‘– Select –‘, ‘usces’) || $_POST[“delivery”][“pref”] == ‘– Select –‘ )
$mes .= __(‘enter the prefecture’, ‘usces’) . “<br />”;
if ( WCUtils::is_blank($_POST[“delivery”][“address1”]) )
$mes .= __(‘enter the city name’, ‘usces’) . “<br />”;
if ( WCUtils::is_blank($_POST[“delivery”][“address2”]) )
$mes .= __(‘enter house numbers’, ‘usces’) . “<br />”;
if ( WCUtils::is_blank($_POST[“delivery”][“tel”]) )
$mes .= __(‘enter phone numbers’, ‘usces’) . “<br />”;*/
}

return $mes;
}

このようなフックを作って、name1だけど入力チェックができました。ただカスタムーオーダーフィールドで必須にしたものが効かなくなってしまいました。

これもただコメントアウトをしてるだけなので、いいやり方ではない気がします。

ご教授お願いします。