Jump to content

Buggy (??) ShoppingCartValidateDomain Hook

Recommended Posts

I develop a registrar module and I want to check if a domain is in a list and the prevent registration. I found out that ShoppingCartValidateDomain does the work, but it's not working correct in 'Standard Cart'.

If a domain belongs to the list and the custom message should be displayed instead of this, the message 'Domain must begin with a letter or a number' is displayed. If the domain does not belong to the list, everything is working fine. In 'Moden' template, which is currently deprecated in 7.6.1, the action hook works as expected, showing the correct error message.

add_hook('ShoppingCartValidateDomain', 1, function($vars) {
    if (in_array($vars['sld'].$vars['tld'],$list) {
        return 'my custom error message';

Any ideas?

Edited by nasos75

Share this post

Link to post
Share on other sites

I was just informed from WHMCS team, this is indeed a buggy behavior with bug number CORE-11987. 

Edited by nasos75

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