Hide Price & Add to Cart for Non Logged in Users for Specific Products
This code snippet allows you to hide the price and 'Add to Cart' button for users who are not logged in. You can specify which products you want to set as non-purchasable for non-logged-in users by defining their product IDs in this line of code:
$not_purchasable_products = array( 23, 22 ); // Replace with Products ID you want to set as non purchasable items for non logged in user.
To find the product ID, simply go to your 'Products' section and hover over the product you need the ID for. The product ID number will be displayed, as shown in this screenshot: https://snipboard.io/LDRTbm.jpg