title: woocommerce add to cart button on single product page
body: <p>On WooCommerce, I would like a custom add to cart button redirection for specific categories to contact us page (when customer click on the add to cart button in single product pages).</p>
  
  <p>This is my code:</p>
  
  <pre><code>add_filter( 'woocommerce_add_to_cart_redirect', 'rv_redirect_to_url' );
  function rv_redirect_to_url() {
  
      global $woocommerce, $post;
  
      $product_id = apply_filters( 'woocommerce_add_to_cart_product_id', absint( $_REQUEST['add-to-cart'] ) );
  
      $rv_woo_redirect_url = get_post_meta( $product_id, '_rv_woo_product_custom_redirect_url', true );
  
      if ( ! empty( $rv_woo_redirect_url ) ) {
  
          wp_redirect( esc_url( $rv_woo_redirect_url ) ); exit;
  
      }
  
  }
  </code></pre>
  
  <p>How can I change my code to get it working only for defined product categories?</p>