In this example I’m showing how to improve the Add to Cart button for Drupal Commerce products to show differently based on whether or not users have already purchased a product, or whether the product is already in their cart.
I’m currently working on a site where users are registering for “programs,” which are synonymous with classes, courses, etc. I’m using the following modules (among others) in this example:
- Drupal Commerce
- Commerce Registration
Please understand that when a user registers for a course, they are actually purchasing a product that has a referenced Registration entity.