When an order is placed in WooCommerce, you might want to change/add something in the User Meta programmatically.
For example, you could “check” a custom checkbox in the User Profile. Or maybe assign the User Twitter username. And so on
PHP Snippet: Update User Meta After a Successful Order in WooCommerce
Where to add this code?
You can place PHP snippets at the bottom of your child theme functions.php file (and in case of CSS, this goes at the bottom of the style.css file) – if you need more guidance, please take a look at my free WooCommerce Customization video tutorial.
Did this snippet work?
Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise
And if you think this code saved you time & money, please join the other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance! Rodolfo