title: Get the product ID in WooCommerce 3+ Order items
body: <p>I am trying to get woocommerce thank you page order_id. Using the code below.
  But unfortunately I can't get it. </p>
  
  <pre><code>    add_action( 'woocommerce_thankyou', 'bbloomer_check_order_product_id');
  
  function bbloomer_check_order_product_id( $order_id ){
  $order = new WC_Order( $order_id );
  $items = $order-&gt;get_items(); 
  foreach ( $items as $item ) {
     $product_id = $item['product_id'];
        if ( $product_id == XYZ ) {
          // do something
        }
  }
  }
  </code></pre>