title: Woocommerce Problem disabling the Add to Cart button for unregistered users
body: <p>I use the following code in the functions.php file in the child theme:</p>
  <pre><code>add_filter( 'woocommerce_variable_sale_price_html', 'update_price_html', 10, 2 );
  
  add_filter( 'woocommerce_variable_price_html', 'update_price_html', 10, 2 );
  
  add_filter( 'woocommerce_get_price_html','update_price_html', 9999, 2 );
  
  function update_price_html( $html, $product ) {
  
       if(!is_user_logged_in()) {  // Si el usuario no está logueado
  
          add_filter( 'woocommerce_is_purchasable', '__return_false');
  
          $html = &quot;Necesita registrarse para ver precios&quot;;
  
          return $html;
  
      } else {
  
          return $html;
  
      }
  
  }
  
  </code></pre>
  <p>This code works perfectly fine to hide prices from unregistered users. But in the case of hiding the “Add to cart” button, it presents the problem that it does not hide it in the first product in the category list, although it does for all other products.</p>
  <p>This problem occurs for any product category and / or subcategory, change the “Add to cart” button for the “Read more” button in all the products in the list except the first one.</p>