Limit user registrations to WooCommerce and Memberships

Are you able to provide some insight on how to limit site registrations to these 2 scenarios:

1. WooCommerce checkout
2. Membership Pro 2: just for Memberships that allow registration.

Thank you.