.st0{fill:#FFFFFF;}

Let’s make Woocommerce assign wordpress user roles for new orders 

 December 19, 2019

By  NickLitten

First thing is to add CUSTOM ATTRIBUTES to WooCommerce orders

Click on PRODUCTS | ATTRIBUTE – add a new attribute (for example “course name”) and then we will add the values for this attribute:

Let's make Woocommerce assign wordpress user roles for new orders 1
Woo Product Attributes

Once you’ve entered an attribute you can add the values for that attribute. In this case, I wanted to add several course names that would relate to the user roles that I want to assign to users when they buy this product.

For example, if someone buys the PMP MASTERCLASS then I want to assign an extra user role of “PMP Masterclass” to their user roles. So i added attributes for all the various classes I wold be assigning to user roles:

Let's make Woocommerce assign wordpress user roles for new orders 2

Now – when you look at your products you can update them to add the name of the attribute that we will be using to assign a user class

Edit Product

Let's make Woocommerce assign wordpress user roles for new orders 3

Now you can select the attribute you added:

Let's make Woocommerce assign wordpress user roles for new orders 4

You can add multiple attributes.

Remember to deselect “Visible on the product page “

Let's make Woocommerce assign wordpress user roles for new orders 5
Visible on the product page

And that’s that šŸ™‚

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

Iā€™m always looking for awesome input, feedback and critique!

>