Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    You can retrieve order item meta (wepo product options) using below code.

    $order_id = 758; // Replace with the ID of the order you want to retrieve the order item meta from.
        
    // Get the order items for the order.
    $order = wc_get_order( $order_id ); 
    $order_items = $order->get_items();
    
    foreach($order_items as $item_id => $item){
        wc_get_order_item_meta($item_id, 'test', true); //Relace test with field name
    
    }

    If you want to retrieve the order item meta (wepo product options) using SQL query then the order item meta is available in wp_woocommerce_order_itemmeta table. 

    SELECT meta_value
    FROM wp_woocommerce_order_itemmeta
    WHERE order_item_id = ‘item_id’
      AND meta_key = ‘field_name’

    ‘Item_id’  is the ID of the order item for which you want to retrieve the data, and ‘field_name’  is the name of the metadata field you want to retrieve(wepo field name).

    Thank you!

Viewing 1 replies (of 1 total)

The topic ‘Export extra product option with SQL requestion’ is closed to new replies.