- Issue created by @lhubbert
- 🇺🇸United States john.oltman
Currently any solution to this would require a custom module. As you figured out, doing separate variations for the adult and child tickets creates the issue that they each have their own registration cap instead of sharing one cap. One thought is to use a single variation but with a field on the order item used for add to cart that the user selects for adult vs child - you then setup a custom condition in your module based on that field that you can then use to drive a discount for the child. Another option is a field on the variation, you then create a custom price resolver in your module that looks at the field. Custom code any way you slice it - at least right now. In the future, I could see a new submodule of registration perhaps named registration_settings_group that allows N variations to share a single settings entity - which means multiple variations could share the same cap.
- 🇮🇳India Bunty Badgujar Delhi
Hello @john.oltman,
I have a similar requirement for my project, so I developed a sandbox module( https://www.drupal.org/sandbox/bbadgujar/3454345 → ) to make capacity global across product variants. I utilized a new boolean field, ConstraintValidator, and EventSubscriber to achieve this functionality. I would appreciate it if you could review the sandbox and provide feedback on whether this approach can be aligned with the feature development of the Commerce Registration module.