- Issue created by @hockey2112
- π©πͺGermany jurgenhaas Gottmadingen
I don't know Commerce well enough, especially the anonymous checkout which creates a user account automatically. But I would assume that the user needed to be created before the order can be completed, because that user needs to be attached to that order, and for that to be possible, the user needs to be present by then.
If that assumption is correct, you could create a model that starts with the order being created or completed. Then the model can load the referenced user and assign a role to that user.
Samples on how to assign roles to users can be found in the ECA Guide Library. Hope that helps?
- πΊπΈUnited States nicxvan
@jurgenhaas is correct, the best way would be on the order status change (not creation cause it's created as a cart)
Then you can get the user and add the role once payment is complete.
- πΊπΈUnited States hockey2112
The problem is that these users are purchasing memberships. We don't want to have any users registered who are not members, and they must purchase that membership fee in order to become a member.
- πΊπΈUnited States nicxvan
Yes, that should not be a problem, once they have finished the purchase they will have an account created by commerce.
Then you can track that order in ECA and set the role. - πΊπΈUnited States goose2000
Hi, following this, I would like to do this. Although, in my case, my users are all authenticated and exist before shopping.
Is that doable? More doable? The video in the library, 3 conditions met and add new role was helpful, thank you.