I am designing a form for people to sign up for classes. Each class is a single product. I want to assign a custom capability to each product and then add the capability to the user who purchases each product. This capability allows access to pages and/or content related to that class/product. I just need some help assigning the capabilities to the user on submission.
Here is what I have so far:
Can you help me with my syntax and the missing functions to get the field ids for purchased products? Am I heading in the right direction here?