Skip to content

Instantly share code, notes, and snippets.

@rwkyyy
Last active November 25, 2023 15:54
Show Gist options
  • Save rwkyyy/11c69d5d0791f15ce7c8c6c13d9083a4 to your computer and use it in GitHub Desktop.
Save rwkyyy/11c69d5d0791f15ce7c8c6c13d9083a4 to your computer and use it in GitHub Desktop.
allow sensei LMS users to re-purchase courses (re-take them)
// fix repurchase courses
function custom_remove_sensei_course_restriction() {
remove_action( 'woocommerce_add_to_cart', ['Sensei_WC', 'do_not_add_course_to_cart_if_user_taking_course'], 10 );
}
add_action( 'init', 'custom_remove_sensei_course_restriction', 30 );
@rwkyyy
Copy link
Author

rwkyyy commented Nov 25, 2023

updated to initt as in some cases it would not trigger correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment