会員登録の必須項目

フォーラム 使い方全般 会員登録の必須項目

  • このトピックには3件の返信、2人の参加者があり、最後にjasrevoryにより8年、 4ヶ月前に更新されました。
4件の投稿を表示中 - 1 - 4件目 (全4件中)
  • 投稿者
    投稿
  • #76346
    jasrevory
    参加者

    ——————————————-
    WordPress のバージョン: 4.3.1
    Welcart のバージョン:1.61
    ご利用のテーマ:マテリアルバージョン: 2.7.1
    症状を確認したブラウザ:
    サーバー(会社名、サービス名):
    SSLの利用: なし
    WordPress のパーマリンク設定:なし
    ——————————————–
    こんにちは
    お世話になっております。
    会員登録の必須項目を変更したく以下を追記しましたが機能しません

    アスタリスクの解除
    テーマのfunctionに
    ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
    /***入力必須の変更****/
    add_action(‘usces_action_essential_mark’,’my_action_essential_mark’,10,2);
    function my_action_essential_mark($data,$field){
    global $usces_essentialmark;
    $essential=array(‘zipcode’,’country’,’states’,’address1′,’address2′,’address3′,’tel’,’fax’);
    if(in_array($field,$essential) ){
    $usces_essential_mark[$field]=”;
    }
    }
    ーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
    と追記しました
    usc-e-shop/function/function.phpの
    ーーーーーーーーーーーーーーーーーーー
    function usces_get_essential_mark( $fielde, $data = NULL ){
    global $usces_essential_mark;
    do_action(‘usces_action_essential_mark’, $data, $fielde);
    return $usces_essential_mark[$fielde];
    }
    ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
    は変更が必要だったりしますか

    必須条件の変更
    こちらもテーマのfunctionに追記しましたが機能しません
    ーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
    /*****必須条件変更****/
    ///add_filter(‘usces_filter_customer_check’,’my_filter_customer_check’);
    function my_filter_customer_check($mes){
    $mes=”;

    if ( !is_email($_POST[‘customer’][‘mailaddress1’]) ||trim($_POST[‘customer’][‘mailaddress1’])==” || trim($_POST[‘customer’][‘mailaddress2’])==” || trim($_POST[‘customer’][‘mailaddress1’]) != trim($_POST[‘customer’][‘mailaddress2’]) )
    $mes .= __(‘e-mail address is not correct’, ‘usces’) . “<br />”;
    if (trim($_POST[“customer”][“name1″])==””)
    $mes .= __(‘Name is not correct’, ‘usces’) . “<br />”;
    // if ( trim($_POST[“customer”][“name3”]) == “” && USCES_JP )
    // $mes .= __(‘Invalid CANNAT pretend.’, ‘usces’) . “<br />”;
    // if (trim($_POST[“customer”][“zipcode”])==”” )
    // $mes .= __(‘postal code is not correct’, ‘usces’) . “<br />”;
    // if ( $_POST[“customer”][“pref”] == __(‘– Select –‘, ‘usces’) )
    // $mes .= __(‘enter the prefecture’, ‘usces’) . “<br />”;
    // if ( trim($_POST[“customer”][“address1″]) ==””)
    // $mes .= __(‘enter the city name’, ‘usces’) . “<br />”;
    // if ( trim($_POST[“customer”][“address2″])==”” )
    // $mes .= __(‘enter house numbers’, ‘usces’) . “<br />”;
    // if (trim($_POST[“customer”][“tel”])==”” )
    // $mes .= __(‘enter phone numbers’, ‘usces’) . “<br />”;
    // if(trim($_POST[‘customer’][“tel”]) && preg_match(“/[^\d-]/”, trim($_POST[“customer”][“tel”])) )
    // $mes .= __(‘Please input a phone number with a half size number.’, ‘usces’) . “<br />”;
    return $mes;
    }
    ーーーーーーーーーーーーーーーーーーーーーーー
    こちらもusc-eshop/classes/usceshop.class.phpに変更が必要だったりするのでしょうか

    条件変更のコードは小さなECサイトのWordpress+welcart導入・設定ガイドを参照にしましたがどちらとも機能せず会員登録の必須項目が変更できていない状況です
    ご教授願います

    • このトピックはnanbuが8年、 4ヶ月前に変更しました。
    #76363
    yskysmr
    キーマスター

    こんにちは。

    まず、文字列を括るのは全てシングルクウォート'(もしくはダブルクウォート")にしてください。
    また、my_action_essential_markの中で、変数名が違っています。

    ✕ global $usces_essentialmark;
    ○ global $usces_essential_mark;

    また、my_filter_customer_checkでは、///add_filter('usces_filter_customer_check','my_filter_customer_check');がコメントアウトされています。
    「会員登録時の必須チェック」を変更したいのであれば、フィルターフック'usces_filter_member_check'をご利用ください。

    最後に、プラグイン配下のソースファイルusc-e-shop/function/function.phpusc-e-shop/classes/usceshop.class.phpは、改変しないようにしてください。

    #76368
    jasrevory
    参加者

    返信有り難うございます。
    どちらもできるようになりました。

    #76370
    jasrevory
    参加者

    度々申し訳ありませんが必須項目が必要なくなったので新規入会ページの住所欄を消したいのですがどうすればよろしいでしょうか

4件の投稿を表示中 - 1 - 4件目 (全4件中)
  • このトピックに返信するにはログインが必要です。