There is at least 2 ways to get custom order item meta data from a defined meta key: 1) Since WooCommerce 3 - Using WC_Data method ...
It is not uncommon to see subscription meta data in tables with
woocommerce_order_items – Stores line items which are associated with orders. woocommerce_order_itemmeta – Stores meta data about order line items.
the parent/ child relationships of order items associated with a bundle.
USAGE with wp_delete_post() to remove related orders containing a specific product (id: 246014 ):
Scenarios, where you'll want to expand the order item meta data in
To get custom order item meta data use the following (where you will replace ' some_meta_key' by the desired order item meta key):
Whenever an order is created, quite a lot is stored in the order's meta data.
Try the following: // Get the $order object from an ID (if needed only) $order = wc_get_order( $order_id); // Loop through order line items ...
WooCommerce stores a large portion of the order related data as post