title: Add to cart validation
body: <p>I need to check a product before adding it to cart.
  I used this function:</p>
  
  <pre><code>function so_validate_add_cart_item( $passed, $product_id, $quantity,$variation_id = '', $variations= '' ) {
  // do your validation, if not met switch $passed to false
  if ( 1 != 2 ){
      $passed = false;
      wc_add_notice( __( 'You can not do that', 'textdomain' ), 'error' );
  }
  return $passed;
  }
  add_filter( 'woocommerce_add_to_cart_validation', 'so_validate_add_cart_item', 10, 5 );
  </code></pre>
  
  <p>This works fine because I see the error message, but the product is added to the cart. Instead I need that it doesn't add the product and it will show the error message. I think is a problem with ajax maybe?</p>
  
  <p>Thanks!</p>