• Resolved vi54

    (@vi54)


    Hi, I emailed support past week but did not receive an answer. So I kindly try here.

    How to grab the product’s option.

    The documentation states: to get the meta field of the order
    I looked up the field name and its 10974_my_fieldname

    $myvar = $order->get_meta( ‘10974_my_fieldname’);
    echo $myvar;

    This displays absolutely nothing.
    Yes I am able to get all other $order information such as items, price, shipping… etc. I just need to have the exact item’s option value.
    Please help me to display the field name’s value.
    Thank you.

    • This topic was modified 2 years, 11 months ago by vi54.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Tomasz WP Desk

    (@tomaszwp)

    Hello @vi54

    I found this mentioned thread in our PRO inbox. We wrote back then within 20 minutes so I assume that our email ended up in SPAM. We are sorry that our answer did not arrive when it was needed the most.

    The values of specific FPF fields are stored in the wp_woocommerce_order_itemmeta table. These values are linked to a specific product with order_item_id and the definition of the specific meta_id field.
    It is possible to use the function
    wc_get_order_item_meta($item_id, $key, $single)
    and use field label as a$key.

    Plugin Support Tomasz WP Desk

    (@tomaszwp)

    I am marking this topic as resolved as we have not received any new replies.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get Option values in php’ is closed to new replies.