WooCommerce on order complete – set user role to

Can’t seem to find the answer or where to look for this question but maybe someone who has been down this route will know.

On a successfully WooCommerce order I just want to add some extra code to set the role of the User who made the order to “paid member”.

Read More

So it will just update row of dbname_capabilities (in dbname_usermeta) where the user_id = the user_id and set it to a:1:{s:10:”paidmember”;b:1;}.

The idea of this is then that member will then have access to certain pages on the site after he has paid automatically.

Thanks for any help. 🙂

Related posts

Leave a Reply

1 comment