title: Querying custom product_type Woocommerce
body: <p>I'v created a custom <code>product_type</code> in Woocommerce as below.</p>
  
  <pre><code> function register_simple_booking_product_type() {
          class WC_Product_Booking extends WC_Product{ 
              public function __construct( $product ) {
                  $this-&gt;product_type = 'booking';
                  parent::__construct( $product );
  
              }
  
          }
  
  
      }
      add_action( 'init', 'register_simple_booking_product_type' );
  
      function add_simple_booking_product( $types ){
  
          $types[ 'booking' ] = __( 'Simple booking' );
  
          return $types;
  
      }
      add_filter( 'product_type_selector', 'add_simple_booking_product' );
      function simple_booking_custom_js() {
  
          if ( 'product' != get_post_type() ) :
              return;
          endif;
  
          ?&gt;&lt;script type='text/javascript'&gt;
              jQuery( document ).ready( function() {
                  jQuery( '.options_group.pricing' ).addClass( 'show_if_booking' ).show();
              });
          &lt;/script&gt;&lt;?php
      }
      add_action( 'admin_footer', 'simple_booking_custom_js' );
  </code></pre>
  
  <p>From here I would like to query the product by <code>product_type</code>. Though the product_type appears in the <code>post_meta</code> in the Wordpress database, the products created as <code>booking</code> type only appear when I query for <code>simple</code> product type. How can I query for just products of the <code>booking</code> <code>product_type</code> ? </p>
  
  <pre><code>$args = array(
      'post_type' =&gt; 'product',
      'tax_query' =&gt; array(
          array(
              'taxonomy' =&gt; 'product_type',
              'field'    =&gt; 'slug',
              'terms'    =&gt; 'booking',
          ),
      ),
  );
  $query = new WP_Query( $args );
  </code></pre>