update_option での会員ランクの変更追加が動かない

フォーラム 使い方全般 update_option での会員ランクの変更追加が動かない

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

    ——————————————-
    WordPress のバージョン:5.5
    Welcart のバージョン:1.9.32
    PHP のバージョン:7.3
    Welcart専用の拡張プラグインとバージョン:ないと思う
    ご利用のテーマ:Welcart Basic
    症状を確認したブラウザ:Chrome
    サーバー:Wordpress.com
    SSLの利用:利用しているはず
    ——————————————–
    update_option を使った会員ランクの変更をしたいのですが、
    動かないようです。
    以下の二つを参考にしています。
    https://www.welcart.com/community/forums/topic/%e4%bc%9a%e5%93%a1%e3%83%a9%e3%83%b3%e3%82%af%e5%90%8d%e3%82%92%e5%a4%89%e6%9b%b4%e3%80%81%e3%81%be%e3%81%9f%e5%89%8a%e9%99%a4%e3%81%97%e3%81%9f%e3%81%84
    https://www.welcart.com/community/forums/topic/usces_construct%e3%83%95%e3%83%83%e3%82%af%e3%81%ab%e3%82%88%e3%82%8b%e4%bc%9a%e5%93%a1%e3%83%a9%e3%83%b3%e3%82%af%e3%81%ae%e8%a8%ad%e5%ae%9a%e5%a4%89%e6%9b%b4

    下記のようなコードをWelcartbasicテーマのfunctions.phpに追加していますが、
    動いていないようです。
    動いているかいないかは、会員管理で新規会員登録ページの4種のランクの表示が変わるかで確認しています。
    確認の仕方がそれであっているかも不明なのですが、いかがでしょうか。
    ーーー

    
    function my_creating_member_rank_data(){
    	$customer_status = array(
    		'360' => __('Level1','usces'),
    		'365' => __('Level2','usces'),
    		'370' => __('Level3','usces'),
    		'1000' => __('非会員','usces')
    	);
    	update_option('usces_customer_status', $customer_status);
    }
    add_action('wp_enqueue_scripts', 'my_creating_member_rank_data');
    

    ーーーー

    #94502
    reno-cre
    モデレーター

    下記のコードでは問題無く反映出来ました。
    wp_enqueue_scripts が違うかもしれませんね。

    add_action( 'usces_main', 'AAAAA' );
    function AAAAA() {
    global $usces;
    $usces->member_status = get_option( 'usces_customer_status' );
    $usces->member_status = array(
    '360' => __('Level1','usces'),
    '365' => __('Level2','usces'),
    '370' => __('Level3','usces'),
    '1000' => __('非会員','usces')
    );
    update_option( 'usces_customer_status', $usces );
    }
    
    #94514
    sagawa
    キーマスター

    reno-cre様

    おっしゃる通り「’wp_enqueue_scripts’」→「’usces_main’」の間違いですね。
    ありがとうございます。

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