Vote up!
Vote down!

Selling courses with drupal commerce

Hello all, I am proud to be using this great framework. Thanks!

I would be grateful for an opinion from the DC experts.

We are selling online courses on our website (www.zegenie.com) which is being ported to drupal. We are now facing this last hurdle before we deploy.

Right now we have three types of entities:

  1. Product
  2. Node: Product display
  3. Node: Final course (Access granted once Product purchased - We are using the method shown on Vimeo with node access to sell access to individual nodes.

Is there a way to merge the two nodes into one?
i.e. the product display automatically hides the 'add to cart' button and shows the content when the user has purchased?

PS: In the future, we will need to implement a subscription module that will allow subscription to expire per node (vs. site-wide / role as the current modules operates.) Maybe we can invest / work with the developers of these modules to do that.

Thanks a lot in advance!

Asked by: ramez_rafla
on August 23, 2012

2 Answers

Vote up!
Vote down!

Sure. There are many ways to do this.

You can do that with some code using hook_form_FORM_ID_alter() and hide the add to cart section. Or you can use hook_node_view to add and remove content from the product display page.

You can also render the final course node into the product display node by using the hook_node_view or template_preprocess hooks.

Good luck.

Answer by: exeapps
Posted: Aug 24, 2012
Vote up!
Vote down!

Hi exeapps,

Thanks a lot.

How do I (within those hooks) know if the user has purchased the product?
Aside from querying the db, is there a clean way of doing this (a function of some sorts)?

Answer by: ramez_rafla
Posted: Aug 24, 2012