Details
Description
We did this for cPanel per CORE-2849. This implementation is basically the same.
When creating a Package, we need an option for "Enable Selling Sub-Domains", which will allow a list of domains to be provided.
If this is enabled on the Package, when a user checks out instead of a Domain field, there is a Sub-Domain and Domain field, where the Domain field is populated with the domains provided on the Package.
The cPanel implementation shows these as 2 separate fields, and I don't know if this is possible, but if so, it would be better if the fields are on the same line separated with a period, for better UX.
The module will check availability of the sub-domain by doing an A record DNS lookup, like the cPanel implementation. If there is no A record, the sub-domain is available and we allow it to be created.