Get WooCommerce Product Input Fields in functions.php
-
Hi,
We use your WooCommerce Product Input Fields option on our productpage.
How can I get the value of this inside my functions.php?I try to load the following code and want to include the value of WooCommerce Product Input Fields:
add_action('woocommerce_payment_complete', 'custom_process_order', 10, 1); function custom_process_order($order_id) { $order = new WC_Order( $order_id ); $myuser_id = (int)$order->user_id; $user_info = get_userdata($myuser_id); $items = $order->get_items(); foreach ($items as $item) { if ($item['product_id']==24) { // Do something } } return $order_id; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get WooCommerce Product Input Fields in functions.php’ is closed to new replies.