1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Update roles when order status is completed
  1. Home
  2. Knowledge Base
  3. Advanced
  4. Update roles when order status is completed

Update roles when order status is completed

By default, the new user’s role is updated when the order status is changed to ‘Processing’. You can change this to update the new user’s role when the order status changes to ‘Complete’ using this snippet:

<?php
/**
* Assign roles when status is set to completed
*/
add_action( 'woocommerce_order_status_completed', 'wcmo_assign_roles_after_purchase', 10 );

Follow these steps to add the snippet to your site.

Was this article helpful?

Need More Support?

If you can't find the answer that you're looking for, then please use the link below to raise a support ticket.
Contact Support

Related Articles