Jump to content
JimJ

Client sub domain on order form

Recommended Posts

Hi,
This is not related to offering our own pre-defined domains as sub domains.
This is about a client wanting to host a sub domain of their own domain.

If when ordering you select "I will use my existing domain and point it myself" and you enter a sub domain, it is not allowed as the regex seems to be testing for a first level domain and doesn't allow subs.

See screenshot.

Is there anyway i can change this so a client can order hosting for their own sub domain as per the screenshot? We are seeing this as a huge problem as a lot of clients like to host subs with us.

Thanks in advance.

whmcsdomain.png

Share this post


Link to post
Share on other sites

Hi Jim,

On 05/07/2019 at 20:03, JimJ said:

If when ordering you select "I will use my existing domain and point it myself" and you enter a sub domain, it is not allowed as the regex seems to be testing for a first level domain and doesn't allow subs.

if I recall correctly, this validation was "enhanced" in v7.7...

Quote

CORE-12666 - Refine subdomain detection for "Existing Domain" option in cart

i've just tried what you want to do in v7.5 and it worked without any issue, so probably would with v7.6 too - but as you say with v7.7+, you'll get the error you describe.

and for further on a fix for that specific error, there is a help page below - but those solutions would be irrelevant to your situation as they centre on issues with the TLD, whereas your issue is with the SLD.

https://help.whmcs.com/m/85428/l/1034165-troubleshooting-invalid-domain-name-provided-messages

On 05/07/2019 at 20:03, JimJ said:

Is there anyway i can change this so a client can order hosting for their own sub domain as per the screenshot? We are seeing this as a huge problem as a lot of clients like to host subs with us.

whether you can tweak the JS i'm not sure.... just taking the domain as normal at that stage and adding a subdomain product custom field (to be completed on the following page) would be another option.

you could slightly (ab)use the existing subdomain option (by editing the configureproductdomain.tpl template), remove the TLD dropdown field and get your users to enter the full subdomain in the box, e.g mysub.mydomain.com

vCRqBXN.png

the cart will accept it without generating validation errors, but I don't know for sure how it would handle it in the back-end - my inclination is that it would work, but that would need testing.

Share this post


Link to post
Share on other sites

Thanks Brian, really appreciate your input.
It used to work for sure but doesn't anymore with the latest version.
Not sure the change was thought through properly as basically nobody can signup and host a sub domain anymore unless its a pre-defined one 😞

Share this post


Link to post
Share on other sites
3 minutes ago, JimJ said:

Not sure the change was thought through properly

I don't know if it was requested by users, or just another one of those bright ideas that someone had during development...

4 minutes ago, JimJ said:

as basically nobody can signup and host a sub domain anymore unless its a pre-defined one 😞

unless they use that template hack I outlined, but that assumes a) you aren't using subdomains as an option already and b) there's no guarantee that WHMCS don't add validation to subdomains in the future, so I don't know how long this solution would last.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated