How to add dynamic fields to cart and checkout?
I am trying to add editable name and email address fields to the cart based on the quantity of the item ordered. Users register for a course by adding a class to the cart. Often the person doing the registering is not the person actually attending the class. To avoid confusion and work spent identifying the actual attendee, I want to collect the name and email of the attendee at registration so I can send course materials, reminders, certificates etc. to the correct person. It would also be helpful to register more than one person per class at a time.
What I am trying to do is have each class in the cart show name and email fields that match the quantity ordered. I was thinking that the information would then be saved in a session variable and inserted using multiple inserts to an order/class/attendee table in the db when PayPal returns the payment confirmation and the orderdetails are inserted into the db. I don't know whether this is a feasible way to do this or whether there is a better way to do this. If you can recommend a saner way, I'd be happy to do that.
I am tripping over my own ignorance, so any help and advice you can offer toward making this work will be much appreciated!