Disable subscribe to course when payment complete

Home Forums Legacy Support Support queries How-to & Troubleshooting Disable subscribe to course when payment complete

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #209645
    gogowebdev
    Spectator
    I have heavily customized my installation with hooks, actions, and filters.  I'm using batches to create individual "classes" within each course.  There are some customized reports that require a student to be enrolled in the class before the payment has actually been completed so I'm adding the student to the class before the woocommerce payment process is complete.  In addition, I have some customized payment amount requirements, which requires one product for all courses and then the final amount is adjusted based on the students profile. The issue is that the student is being enrolled in the "associated courses" (there are several of them per product) when an admin changes the payment status to complete.  I would like to disable this default functionality.  I've looked over the code and can't find where this is happening.  What hook can be used to disable this?
    #209885
    logan
    Member
    Well very simply you just need to remove the hook that aassigns courses to user : add_action('init',function (){   $that = BP_Course_Action::init();   remove_action('woocommerce_order_status_completed',array($that,'bp_course_enable_access')); });   this code will do that for you .now student wont be assigned to associated courses whenever the product is marked complete but now you have to manually add the user to the course or by programatically .
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Disable subscribe to course when payment complete’ is closed to new replies.