title: Replace add to cart button for unlogged users in WooCommerce
body: <p>In WooCommerce, I don't want to show product add to cart button for unlogged users. I am using the code bellow changing add to cart button:</p>
  <pre><code>// Replace add to cart button with link for users who aren't logged in
  add_filter( 'woocommerce_loop_add_to_cart_link', 'replace_loop_add_to_cart_button', 10, 2 );
  function replace_loop_add_to_cart_button( $button, $product  ) {
      // Logged in users see add to cart button
      if( is_user_logged_in() ) return;
  
      $button_text = __( &quot;Sign up for pricing&quot;, &quot;woocommerce&quot; );
      $button = '&lt;div&gt;&lt;a class=&quot;button&quot; href=&quot;https://example.com/link&quot;&gt;' . $button_text . '&lt;/a&gt;&lt;/div&gt;';
  
      return $button;
  }
  </code></pre>
  <p>It works on all pages except on single  product pages. The product page continues to show the default add to cart button. What am I missing?</p>