Add this code in Wplms-customizer Plugin->customizer_class.php.


  1. Add this line in function __construct()



 add_action('template_redirect',array($this,'wplms_free_units_not_available'),10,9);

     



        2. Add the following code After function __construct()


 

function wplms_free_units_not_available(){
			if(is_singular('unit') && ! is_user_logged_in())
				wp_redirect( home_url() );
			
		}