You’re very close.
$order->update_meta_data()
will update the meta value inside the $order
object, but it will not store the change in the database. To save changes to a WooCommerce CRUD object you need to run the save()
method:
if ( $response_code == 200 ) {
$order->update_meta_data( 'token_received_key', $token );
$order->save();
}
Related Posts:
- WordPress Woocommerce REST API JSON Error
- Working with a json feed & trying to figure out how best to import
- Delete product image using WooCommerce API?
- WP/WooCommerce REST API cart/checkout/order [closed]
- Woocommerce change tax rate programmaticly
- How do I get the latest note on the order at woocommerce? [closed]
- Creating woocommerce product using WordPress REST API
- Create WooCommerce new order with specific ID
- Output JSON object with woocommerce products
- Woocommerce: Prevent sending of email when order is “Completed”
- how to do a processing Orders into Complete after x Minutes or x hour in WooCommerce [closed]
- Woocommerce REST API allow normal users make an order
- WooCommerce quick checkout form? [closed]
- Check if a category has a parent category in WooCommerce REST API
- WooCommerce order complete email logic
- Expired session error (admin) when I try to make a call to WooCommerce api [closed]
- WooCommerce orderby template disappears and not longer works on search page
- How can I get all the woocommerce api orders [closed]
- wc_get_products() not return the images details
- How to get woocommerce selected variation from order object
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- Update Customer JWT Woocommerce
- Woocommerce, finding the ordinal number of a purchase for a certain product
- Cancelled orders move to Trash automatically in Woocommerce – how to disable?
- WordPress SMS API integration without plugin error
- Absolute search against wordpress api
- how can i add an additional action into woocommerce admin order page through my plugin?
- Create a regular post for every WooCommerce order
- Retrieve Data from Custom Endpoint
- How to alter taxes amounts when updating an order
- WordPress woocommerce new order email not working
- Custom Email via Hook only for completed order
- Access custom meta_data in processing order email
- Sort products by Sale price and stock status
- Create order actions from custom fields woocommerce
- How to sort products by price ASC and place all no price products to the end? (Woocommerce)
- Getting WordPress fatal error when hitting WooCommerce API
- woocommerce REST api on the website’s front-end
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- Change the customer’s name to a link on an order management page
- How can I get a get a list of customers from a list of email addresses?
- How to get WordPress to respond to a GET request at the end of a Woo product page
- email address non required
- Add button linked to single product page on order detail page
- Multiple sorting criteries (order by)
- Woocommerce order_complete email dont send after changing order status via sql
- WordPress returning “XHR” even when access keys are used
- Conditional email recipient based off Shipping Method [closed]
- How to programatically create a WooCommerce downloadable product?
- Users credentials and syncing from third party with WooCommerce
- Product atributes in title of order (not in description)
- Manual Woocommerce Complete order Emails
- WooCommerce: Order Details Table > Add Product Meta
- WooCommerce REST API endpoints don’t exist
- Fetch products with filter by similar categories at same time
- Woocommerce API REST search by multiple keywords
- Create WordPress account on different domain when WooCommerce order completed
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Woocommerce admin order email customize – remove product short description
- Critical error on woocommerce checkout page
- Hide tabs on woocommerce product editor for user role
- Woocommerce add_to_cart non-register visitor not working
- Authenticate user into wordpress via 3rd party system, both with the same domain
- WordPress REST API not returning all posts
- How to get woocommerce subscription next payment date or date when subscription expires in woocommerce_subscription_renewal_payment_complete hook?
- How to redefine the sorting of product categories by menu_order?
- Display Message if woocommerce coupon is not applicable to some items in the cart
- (Woocommerce) How to add a custom page between cart and checkout with a file upload field per product item in the cart?
- Force uppercase on some WooCommerce checkout fields input
- Display custom field without plugin in woocommerce
- How to output php between header and woocommerce container
- WooCommerce – How can I make single product gallery show two images on the slider at once?
- Hide the prefix before the price of the product [closed]
- Display Woocommerce Orders for specific author [closed]
- Woocommerce hook on address field change [closed]
- Maintenance mode just for WooCommerce shop pages [closed]
- Same request Mysql/Php not same result
- Get woocommerce coupon code
- Woocommerce change price in cart when discounted
- How do order product categories – on a parent category page – in Woocommerce?
- Add custom parameters to Woocommerce add to cart link
- How to automatically change the status of product from draft to published when stock qty change from 0 > 1
- Delete method giving 500 error, for this endpoint /wc/store/cart/items
- In woocommerce product details not showing
- Re-arrange the Woocommerce checkout page layout
- Parameters in woocommerce_before_add_to_cart_button hook
- How to change user role after login?
- WooCommerce free shipping twice a week
- Product overlapping header
- How to import products to Woo Commerce given that WP All Import keeps timing out
- Firstname and lastname greyout or hidden Billing details at next checkout like username is hidden [closed]
- How to use woo commerce login to authenticate code php pages?
- Click Count on Download a File
- Not all strings are translated
- Custom Woocommerce checkout filed yields a Json error when validating [closed]
- How to display Woocommerce catagories
- eCommerce solution doesn’t want to display its shortcodes or any content where it’s set to [closed]
- Woocommerce hidden fields with meta keys and values. how?
- Creating a woocommerce order when a user creates an account