Discussions

Adding payment to access custom entity.

I am currently working on a paid customized seminar/tutoring site for a client. I have created a custom "Seminar" entity, that includes all of the proper permissions, processes, displays, etc.. for the student to interact with the tutor. The student is placed in a seminar by their educational institution (an account is created for them, and they are assigned to the seminar). When they click the link that is emailed to them, they have the option to go ahead and enroll in the seminar. This is the point at which I'd like to use commerce to handle payment.

Essentially, the seminar entity has a "paid" boolean that indicates of the seminar has been paid for, as well as a reference to an order (which could link to their order page for site administrators). I am guessing the way I need to get this all glued together is as follows-

1) Create a "Seminar Tuition" product in Commerce
2) Create a custom line item that has a field referencing back to the seminar entity.
3) When the user clicks "Enroll", programmatically create a cart, add a Seminar Tuition product to the cart filling in the reference back to the seminar entity (basically their seminar ID), and forward them on to the checkout form.
4) The user goes through the checkout form, supplying their billing address and payment info.
5) Upon successful payment, write a rule (?) to update the seminar entity's (who's ID is referenced in the line item field) "Paid" flag, as well as the seminar entity's reference back to the order.
6) provide the user with the final payment/receipt screen, with a link back to their now enrolled seminar.

This seems a bit complicated, but is about all I could come up with for gluing this all together. Any thoughts on easier ways to do this? Or am I on the right track?

Posted: Oct 29, 2012

Comments

cornelyus on November 11, 2012

I have exactly the same question... I have a content type conference where I added a Product Reference to some products ( registrations and stuff ). When I pay for the registration, I would like that the line item on the order would have the node ID of the content type conference where the product was available and from where the user clicked "add to cart" ..

Any ideas?