• Resolved M.K_Soft

    (@mk_soft)


    Hi there
    I want to add credit for the current user but in this code, every time add two recored!

    add_action('init', 'myFunction');
    
    function myFunction(){
    
        $user_ID= get_current_user_id();
        woo_wallet()->wallet->credit ($user_ID, '50000');
    }

    In this example i will have two record by 50000 amount.

Viewing 1 replies (of 1 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @mk_soft Try to use the bellow code.

    add_action('wp_loaded', 'myFunction');
    
    function myFunction(){
    
        $user_ID= get_current_user_id();
        woo_wallet()->wallet->credit ($user_ID, '50000');
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Add Credit for current user’ is closed to new replies.