title: WooCommerce hide all products of a certain category if not loggedin
body: <p>I have been searching everywhere to find this answer and have even downloaded multiple plugins, all of which haven't worked.</p>
  
  <p>Is there a way to achieve this using PHP?</p>
  
  <p>I have this code:</p>
  
  <pre><code> &lt;?php if( !is_user_logged_in() &amp;&amp; get_field('___unit_price') ): ?&gt;
   &lt;p&gt;Unit Price: $&lt;?php the_field('___unit_price'); ?&gt;&lt;/p&gt;
   &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Which seems to work for specific products but does not work for an entire category, any help would be much appeciated</p>