title: Custom redirection after checkout based on a custom checkout field in WooCommerce
body: <p>I would like 2 redirection links in woocommerce after checkout. The first is the standard checkout link that sends any user to a thank you page. The other would be if they check a box that says they are interested in a membership during checkout. If they are we would like them to be redirected to a membership area. </p>
  
  <p>I found this code for thank you page redirect:</p>
  
  <pre><code>add_action( 'woocommerce_thankyou', 'bbloomer_redirectcustom');
  function bbloomer_redirectcustom( $order_id ){
      $order = new WC_Order( $order_id );
  
      $membership = WHAT FIELD HERE FROM ORDER? // Need a way to set this variable to checkbox true or not.
  
      $url = 'http://yoursite.com/thank-you'; //Thank you page
      $mem_url = 'http://yoursite.com/members'; // Membership page
  
      if ( $order-&gt;status != 'failed' &amp;&amp; !$membership) {
          wp_redirect($url);
          exit;
      } else {
          wp_redirect($mem_url);
          exit;
      }
  }
  </code></pre>
  
  <p>I have a way to add the checkbox to the checkout page (using Woo Checkout Field Editor Pro plugin). I just need a way for this code (which I haven't tested yet) to check if the membership field was checked when the order was placed and redirect to another page.</p>
  
  <p>FYI, we are using PayPal as our primary payment gateway. I don't know if this makes a difference.</p>