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
- Echo SKU in WooCommerce Conformation page [closed]
- How to hide metaboxes in WordPress Admin on WooCommerce “Add Product” page – Remove side sortables for a specific user role
- Hide woocommerce login form
- Custom product loop avoiding duplicates
- how to get woocommerce product id by acf field in wordpress and display product
- Woocommerece category page showing in stock product as out of stock
- Trying to link to a custom css file in a new folder
- Unable to enocde the result of wc_get_products
- Woocommerce – Remove ‘Buy Product’ Button + Make Product Thumbnails Clickable
- Increase product variation limit in woocommerce
- Issue with Woocommerce and extra field in orders data
- How to get an Array from “select” field in advanced custom fields
- WooCommerce widget “WooCommerce Products” template [closed]
- change text “free shipping” in WooCommerce [closed]
- How to get _POST variable on WooCommerce product page (form on homepage)
- How to add ajax loading icon after click add to cart button on woocommerce
- Disable add to cart button when product is out of stock
- WooCommerce add custom product_type_option
- Redirect whole website or pages to /wp-admin in wordpress
- Can’t display product categories on woocommerce getting Invalid taxonomy?
- Changing sale price programmatically, but it’s not shown on front-end
- How do I put woocommerce cart page to my checkout page? [closed]
- Send form data to functions.php
- Customizing the add to cart function
- Hiding all products except for one in wordpress admin panel
- add custom menu in woocommerce dashboard [closed]
- How-To: Get meta data from the users last order in woocommerce
- how to query single product in woocommerce? [closed]
- woocommerce-how can i get all products by their groups! [closed]
- Custom sender email address for specific WooCommerce product
- Anchor link to every product
- Plugin could not be activated because it triggered a fatal error
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- WooCommerce – Inconsistent Indexing of Orders
- Woocommerce custom product with JS script, can’t understand how it works [closed]
- Stock QTY gets negative after order
- Woocommerce REST API authentication with server password [closed]
- How to remove content from hacked pages? [closed]
- Disable WooCommerce Address State Dropdown