If you ever need to change the order status from php here is how to do it.
$order = new WC_Order($order_id);
if (!empty($order)) {
$order->update_status( 'completed' );
}
Possible values: processing, on-hold, cancelled, completed
This is from woocommerce/includes/abstracts/abstract-wc-order.php
Related Posts:
- Ajax call always returns 0
- plugins_url vs plugin_dir_url
- Get list of years when posts have been published
- Where and how to put inline js in pages
- Is it possible to remove the “standard” post format?
- Do WordPress’ cron’s clean up expired transients?
- How to add first name & last name to default registration form?
- Masking logout URL
- How can I programmatically create “child” pages on theme activation?
- Hourly Routine Not Firing ( wp_schedule_event() )
- Warning/Notice about functions.php
- Is checking whether the blog is installed necessary?
- echo or print_r in an admin function
- Overriding methods in a child theme
- WP disobeys disabling of the posts revision feature
- How do I deactivate a plugin for some roles
- How to display more audio file ID3 tags in WordPress
- Searching for content post
- Running CRON on Server with WP Function
- Using separate .php file for functions – how to run on site?
- wp_trash_post function to only apply to posts, not pages!
- Adding widget to dashboard with wp_dashboard_setup not working
- Add Featured image column into wordpress admin on pages AND posts
- How can I change the do_action function in footer (copyright area)
- How to display post content instead of excerpt
- Access Plugin data from Functions.php
- Register and load scripts
- Having a Function Inside of the Loop
- how to call a function only in specific pages and exclude it from other pages
- Which action does wp_update_user triggers?
- Use register_setting() in a loop
- Dynamic dropdown from database table
- About cron delete user with meta_key
- Add dynamic links in WordPress custom theme
- WordPress website Rs changed to currency symbol
- Unable to login using username
- How to change the order of Jquery in the footer of my theme?
- Functions in custom theme
- Attempt to change jQuery version caused White Screen of Death
- check if author has published posts in custom post type, then send mail
- media resize/crop possibilities?
- adding custom script to functions file
- Difference b/w Simple function call & do_action call
- What’s wrong with my use of plugin_url()?
- edit formatting.php in a theme so it wont get overwritten
- Hook into a function without a hook?
- add_action template_redirect not working for home page
- Way to store featured image width and height in two separate variables?
- Insert template-part inside the content
- Filter yoast canonical add_action priority [closed]
- Should I store functions in separate folder?
- How can I modify the element on all pages?
- Add unique id to Preview URL
- the_password_form functions not working together
- Numbering lines of code with the tag?
- Latest Foursquare Checkin function
- PHP 7.1 | Warning: A non-numeric value encountered in
- Way to redirect all Product Sub Category to its Main category Page?
- Fatal error: Call to undefined function is_even()
- Is this an acceptable practice for WordPress theme development?
- How to use parent theme functions in child theme functions.php file?
- search form leads to 404
- How to change a specific admin label
- Custom image sizes showing in Classic Editor only when upladed directly to post
- How to hide WooCommerce product title and short description to non logged in users?
- How to loop while adding data to database?
- How to add extra value to permalink
- Bulk updating a group of WordPress Pages every 10 minutes
- localize_script but data changes dependent on product ID
- remove_filter function to unhook twentysixteen parent theme function
- Can we have conditional CSS styling?
- Change function without filter hook
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- How to add javascript code into Divi child theme?
- Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role
- Override plugin function to show invoices even if not logged in
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- how can I change the read more link destinations and direct all to the same page?
- ACF Filter return value
- How to build two WordPress site using two different themes with same database (No ! I am not taking about multisite network)?
- How can I stop the hook from breaking the login/logout function?
- Replace image attributes for lazyload plugin on image elements with specific class
- What to do to have access to WordPress functions
- Adding a meta box fields to child theme options page
- Pass max posts to Javascript
- Changing the color of post title [closed]
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- Create html from function
- WP supersize not displaying when different languages flags are selected
- wp_list_pages change of children and anchor of parent
- Admin Panel errors because of functions.php
- WordPress not performing direct update
- Using Output from one Function and calling it into another
- How to add a class and title attribute to the link generated by next/previous post
- “Headers already sent” while trying to add a CSS file to my login page?
- Remove theme, change theme button and WP version on “Right Now” admin dashboard?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- WordPress Custom wp mail template return full template
- Comment turned Invisible
- How to add more than one menu for logged in members?