Get Custom field from wp_woocommerce_order_itemmeta table
-
Hi,
I have a number of custom fields and I have them outputting to my packing slips using the hook add_action( ‘wpo_wcpdf_after_order_data’, ‘wpo_wcpdf_who_for’, 10, 2 ); , which is great. But I have another plugin, Local Pickup Plus from WooCommerce themselves (Skyverge), which allows the user select the Shop from which to pickup an order. However I cannot get this to work as it turns out it is not stored in the same place as normal custom checkout fields. Looking at the SQL table and searching for a custom field e.g “_order_wcj_checkout_field_3” (created by booster plugin) you find that the custom fields (meta_key and meta_value) for the order are stored in the table “wp_postmeta” along with post ID.The developers of that plugin told me: “The data for Local Pickup Plus is stored as Order Item meta. This is stored in a separate table to normal post meta in the database, on a default install this would be located at wp_woocommerce_order_itemmeta. Within this table you can then extract the data using the _pickup_location_name key if you know the order_item_id that matches your order.”.
So my question is, could your plugin hook (as previously mentioned) be used to query this table and get the value of the _pickup_location_name key?
Thanks- This topic was modified 5 years, 6 months ago by . Reason: formatting
- This topic was modified 5 years, 6 months ago by . Reason: formatting
The page I need help with: [log in to see the link]
- The topic ‘Get Custom field from wp_woocommerce_order_itemmeta table’ is closed to new replies.