SELECT *
FROM `wpet_woocommerce_order_items` a
LEFT JOIN `wpet_woocommerce_order_itemmeta` b ON a.order_item_id = b.order_item_id
LEFT JOIN `wpet_users` f ON f.ID = b.meta_value AND b.meta_key = 'seller_id'
LEFT JOIN `wpet_dokan_orders` c ON a.order_id = c.order_id
LEFT JOIN `wpet_posts` d ON a.order_id = d.ID
WHERE a.order_id = " + value.OrderNum + " AND a.order_item_type = 'line_item';
I am trying to pull various information from woocommerce using an API, essentially, the order item, value, the line total and commissions, I have some data coming in when the API syncs, the API is posting just the order ID (value.OrderNum) which I am using to build the query. here is the woocommerce hook...
function send2VendorAPI( $order_id ){
$order = wc_get_order( $order_id );
$data = array(
'OrderNum'=>$order->get_id(),
);
Then i use this order ID to grab all the information. Thanks for any thoights from the experts on here...