You can use the $posted
parameter to get the right value in your function.
add_action('woocommerce_checkout_update_order_meta',function( $order_id, $posted ) {
$order = wc_get_order( $order_id );
$order->update_meta_data( 'recipient_email', $posted['recipient_email'] );
$order->save();
} , 10, 2);
Verify that $posted is an array not an object with a var_dump on $posted.
if it’s an object replace $posted['recipient_email']
with $posted->recipient_email
Hope it helps đŸ™‚
Related Posts:
- Set attached to state
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Add multiple attributes to product from php
- Woocommerce email template customization [closed]
- How to send an automated email to the customers when product is added woocommerce
- Redirect to another page using contact form 7? [closed]
- Is it possible to send blog posts via email to subscribers?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- How can I concatenate variables to search results title? [closed]
- Function added to hook “new_to_publish” not executing – custom plugin
- Link Posts to External URL
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Help to Create a Simple Plugin to make a post
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- WordPress eMails not working
- How to Save settings of custom tab product page in admin side in a database?
- Get post id in Post Page within Wp-admin
- Send Processing Order Email from custom payment plugin
- how to add meta for order in woocommerce
- Show WooCommerce products based on query parameters on redirect
- additional fields based on the quantity of products selected
- Difficult case to solve – Select + select = result(related data)
- How to get 1 or 2 specific posts on top of my wordpress blog?
- Portfolio + Blog: multisite or plugin?
- Serve different files depending on OS/Browser
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Accessing post’s meta data based on user’s click of a post
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- How to configure two SMTP Server for wordpress
- Absolute Image URL in srcset is appended to the upload dir
- Dropdown menu on custom page with product to choose number of products per page
- Woocommerce plugin for minimum order and add-to-card-step
- Add Product Subtitle to Woocommerce Product Page
- Change wordpress current_time function to different timezone
- Only Homepage not loading properly
- WooCommerce shop page orderby [closed]
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- Email Bounce Address
- woocommerce 3.2.1 not sending order notification emails
- View Private Published Page with URL Code (no login required)
- Integrating non-WooCommerce and WooCommerce Orders together [closed]
- Change the method of a class from child function.php
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- Override Javascript in a Plugin?
- WordPress Registration Email by Role
- WooCommerce Custom Product to checkout
- Woocommerce – How to populate custom select field with stored values on checkout page?
- Automatically add attributes to woocommerce product?
- Reduce Drop down Menu Width in WordPress
- The problem with WordPress Importer
- Cron job not firing
- Solutions to repost categories into multisite blogs?
- How to enable qTranslate languages tabs in custom plugin page
- How do I “get the next 10 posts after post_id == x”?
- Hiding posts – WP Hide Post not working
- Create digital-virtual-downloadable WooCommerce products from the frontend using Gravity Forms? [closed]
- submit posts by unregistered users in wordpress
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- What is generating my meta og:description?
- finding whether request is for post, and post id
- Any built-in function to associate a post to category through a plugin?
- How to hide some section in WordPress under Post
- Display post lists in 2nd paragraph
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Can’t delete Draft Post [closed]
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- How to enable specific plugin only based around shop manager role?
- What are wsm tables for?
- WordPress automatically removes line break
- Matching Chapters to a Custom posts [closed]
- How to display the “ratingValue” and “ratingCount” values ​generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- Why required field not working in Country dropdown in WooCommerce –
- Woocommerce API HTTP Response 401
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- Add woocommerce variation images in gallery?
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- WordPress display breadcrumbs using Yoast plugin [closed]
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- Outbound link autometic converted into linkdirect , and not opening
- Woocommerce dependent plugin
- Get sent emails without email logs
- How to check current user before all actions and filters?
- New databes tables with – WooCommerce – for developers [closed]
- Display by Category in Admin
- get current date + 90 days and checking every day
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- woocommerce product countdown not showing in variable product? [closed]
- Change commission_status paid when withdraw_status vendor is completed
- I want to disable Cash on delivery based on product tag in woocommerce Checkout Page [closed]
- Is there a way to create custom product templates based on category on WooCommerce?
- Woocommerce Deposit, then random payments until product paid in full [closed]
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags