Hello Brian Kim,
The code was not for you, it just hides the price from the search dropdown. There is no option to hide price for unregistered users, so – https://prnt.sc/xny94k
Regards