Thanks, will do next time. I figured this one out:
function my_custom_wc_api_order_response( $order_data, $order, $fields ) {
$customer_info = get_post_meta( $order->id, '_customer_info', true );
$order_data['payment_details']['customer_info'] = $customer_info;
// Apply filters if necessary
if ( $fields ) {
$order_data = WC()->api->WC_API_Customers->filter_response_fields( $order_data, $order, $fields );
}
return $order_data;
}
add_filter( 'woocommerce_api_order_response', 'my_custom_wc_api_order_response', 10, 3 );
Related Posts:
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- How To Change The Html of Products filtration sidebar in Woocommerce?
- How to sort WooCommerce products page by latest in-stock items first?
- Variation prices breakdown only for single product page
- How to add custom checkout field in user details mail template
- Remove Woocommerce product link
- Change the footer text on the login page
- How can I hook into and edit the text of a wp_nav_menu tag?
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- Check if page parent has certain template
- WooCommerce – Customer Order History Pagination
- How to Remove a Filter from the Admin List Table?
- Woocommerce, recognize the loop of related products
- Find variables available at a given hook
- Replace existing content from specific WooCommerce admin orders list column
- Getting my head round WordPress filter
- Woocommerce filter cart and category specific quantity [closed]
- How to set a custom path, for ajax image upload folder in admin?
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- How to call function at the bottom of post using plugin?
- Limiting woocommerce line_total decimal length
- How to add a second ‘place order’ button in WooCommerce [closed]
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Handling Body class based on Template
- WooCommerce Related Products by Attribute
- Automatically remove a canceled order in Woocommerce
- Edit incorrect password message WordPress
- Show prices with tax in Woocommerce Mini Cart [closed]
- Reload part of checkout on changed shipping method
- Trying to build simple deposit code that hooks into woocommerce
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Add a product to checkout via form
- Remove the first 5 characters of the_title and orderby that
- Remove a div from RSS feed
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- How to add an arrow to menu items has submenus
- WordPress Gravatar filter is removing my custom attributes
- how to fix error “called incorrectly, should not be accessed directly”?
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- get_total () returns 0 – woocommerce [closed]
- How to have different site identity logos on each page on Astra Theme [closed]
- Must filter functions receive all arguments passed to them?
- Filter wordpress posts without searching the keywords in the post content
- Display custom field value in woocommerce variable product via jQurey
- Adding custom field to product category and show it to shop/category shop page
- How can I change the background color of divs dynamically (depending on an order-status in woocommerce)?
- Remove span tags from WooCommerce Downloads page
- How to edit post meta data before publishing the post it self wordpress?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- using filter and hook inside class
- Discount in the specific product title using keyword ( Woocoommerce )
- How do I remove an action hook inside a class that is called by another class?
- Need to forward Data from WooCommerce Webhook sent to same site WordPress REST API custom endpoint
- How to override WooCommerce Order Item Meta with data from Cart?
- add_filter() inside another add_filter()
- How can i style “echo apply_filters”
- Add class to all meta boxes for a custom post type
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- Woocommerce Price Text
- For each loop will not append to the_content hook
- Change Checkout “Place Order” text if cart has a specific product
- Send a custom notification to customer on WooCommerce cancelled order status
- Assign new post author IF another user in custom field on post transition
- Woocommerce – add tracking code to another email template
- using custom pages for myaccount in woocommerce
- Add text below WooCommerce short description if metabox value is true
- Is there a hook that I can use when a fatal error occurs?
- how to append ACF field data using one of the following filter/ hooks
- Using WooCommerce Hooks to add product attribute descriptions to customer order email
- Dynamically adding filters
- Woocommerce custom Plugin in wordpress [closed]
- Add a custom class to the body tag using custom fields
- WooCommerce “Checkout Now” button [closed]
- Custom Taxonomy Select Menu: Setting default option value?
- Why doesn’t global $wp_query not get hooked?
- Creating customized php files in theme folder
- Dynamically Generate Functions and Hooks
- How to pass hook variable to function?
- WordPress doesn’t load HTML
- How to internationalize header image?
- How to separate product payment and shipping payment in WooCommerce checkout? [closed]
- apply_filters with several different values?
- How can I modify this code to make the search box include tags and meta
- How can i programmatically change the SKU of a product based on product variation?
- Execute PHP code only with specific user role
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Add a custom WooCommerce settings tab with sections
- Display Sibling WooCommerce Product Categories on Archive Page
- Checking page before applying image restrictions while uploading
- Custom reduce stock code affecting date_modified – How to bypass?
- User filter posts by year
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- How to WP_Query posts order by parent title?
- Display custom product option in admin order details
- Woocommerce order status payment
- Dynamically added custom fields not displayed on WooCommerce email notifications
- Modify WooCommerce used to get all orders in dashboard