- student buys a course
- EDD receives the payment and put it in pending status (I use Sorsawo EDD Bank Transfer)
- Admin switch the payment on Complete (value='publish') (when receives the money in the bank)
- Admin is enrolled instead of the student (BUG)
DEBUGGING
This seems to be the problem:
tutor_utils()->do_enroll($course_id, $payment_id);
Should pass also $user_id somehow, otherwise get_user_id calls get_current_user_id() which loads the current user id (the Admin) instead of the student id.
DEBUGGING
This seems to be the problem:
tutor_utils()->do_enroll($course_id, $payment_id);
Should pass also $user_id somehow, otherwise get_user_id calls get_current_user_id() which loads the current user id (the Admin) instead of the student id.