title: How do you disable redirects on "Add to Cart" on private products with Woocommerce?
body: <p>I've currently taken over a site set up that has a few products set to private so that only a few top level users (roles edited with User Role Editor) can see/interact with them. The problem being that the Ajax &quot;Add to Cart&quot; button for these products runs the add to cart script, but then rather than stay on that page it fires the user into the single product page. Only for these private products.</p>
  <p>The functions file has <code>add_filter( 'woocommerce_add_to_cart_redirect', '__return_false' );</code> added to it, which I assume was added by the previous owner, but doesn't seem to be accomplishing anything.</p>
  <p>I've also tried adding <code>add_filter( 'woocommerce_add_to_cart_redirect', 'wp_get_referer' );</code> which I saw as an answer to another post, but it doesn't seem to be accomplishing anything either.</p>
  <p>Finally I tried
  <code>function custom_add_to_cart_redirect() {  return 'http://site.co.uk/shop/';  } add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' );</code></p>
  <p>I'd seen this on another post but it didn't seem to make a change. I also wasn't sure this was the right way to go because if the user was on a category page, etc then surely they'd be redirected to the front page of the store.</p>
  <p>I'd stripped the site back of plugins on a clone and tried a few things and nothing seemed to be a solution. So even if someone can tell me that one of the above lines of code should work and it must be a custom code conflict somewhere, that would be immensely helpful.</p>
  <p>Cheers!</p>