title: Custom post type data and order item data in WooCommerce
body: <p>I am using a plugin, <a href="https://reigelgallarde.me/doc/woocommerce-custom-post-type-manager/" rel="nofollow noreferrer">WooCommerce Custom Post Type Manager</a>, along with WooCommerce that enables the use of custom post types as products. This is working pretty well for the most part, but I want to be able to control inventory and I am able to see the problem. In the database under the order_item_meta table, the product_id = 0. Because the product_id is empty, there is no way to update the stock on a completed purchase. </p>
  
  <p>I know that WooCommerce made some changes to where it searched if a post_type was a  'product' and if not, certain things failed. I am wondering if there is a filter hook or another way to add the product id with a custom function at checkout? </p>
  
  <p>This is the function I am trying to create to control a custom type of inventory, we are selling event "seats". And no, even the regular "stock" does not work, probably because of the same reason.</p>
  
  <pre><code>function update_course_seats( $order_id ){
    $order = wc_get_order( $order_id );
    $items = $order-&gt;get_items();
    foreach ( $items as $item ) {
      $product_id = $item-&gt;get_product_id(); // this returns 0
      if($product_id != 0) {
        wc_update_order_item_meta( $item, '_seats', 10 ); // example number
      }
    }
  
  //add_action( 'woocommerce_payment_complete', 'update_course_seats');
  </code></pre>