• Resolved naxxed

    (@naxxed)


    Hi,

    I’m trying to pull the extra product option info after an order.

    What variable would I use or how would I go about doing that?

    • This topic was modified 5 years, 11 months ago by naxxed.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    The fields created using our plugin are saved using the function wc_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique = false ) . You can retrieve the value of the fields from the database by using the below function.

    wc_get_order_item_meta( $item_id, $key, $single = true )

    We hope this will help 🙂

    Thank you!

    Plugin Author ThemeHigh

    (@themehigh)

    We hope your issue is resolved now. We are going to mark this thread as resolved.

    Please do let us know if you have any further questions. We are happy to help 🙂

    Thank you!

    I have a question related to this.

    how can I access the parameters $item_id, $key. The only ressource I have is $order_ID, which I use to get the Order Object:

    $order = wc_get_order($order_ID);

    how do I get to $item_id and $key?

    Ok Ive got it

    $order = wc_get_order( $order_ID );
    $items = $order->get_items();

    foreach ( $order->get_items() as $item_id => $item ) {

    // Here you get your data
    $custom_field = wc_get_order_item_meta( $item_id, ‘uniqueid’, true );

    // To test data output
    print_r($custom_field);

    }

    Plugin Author ThemeHigh

    (@themehigh)

    Great!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘What Variable to Access Extra Option Info’ is closed to new replies.