Jump to content

Verify orderforms that the user has right country filled to match domain tld


postcd

Recommended Posts

Hello,

 

i am using WHMCS 6 and using verticalsteps.

 

i would like to warn or prevent WHMCS client to register .us domain while he do not have United States selected as a country.

 

I tried to add various conditions into viewcart.tpl

 

{if $domainvariable eq ".us"}{if $countryvariable nq "United States"}To register .us, you need to enter United States address!{/if}{/if}

 

but nothing seems to work. So i at least can do something like this:

 

{if $domainsinorder}<p>To register .in, .us, .eu please enter the Country that match the TLD region.</p>{/if}

 

But it is too general and shows for all domains.

 

Please do you have idea regarding right condition to prevent or at least warn user when he Checkout?

 

Note that i am not looking for a plugin, module or WHMCS upgrade.

 

Thank You

Link to comment
Share on other sites

i am using WHMCS 6 and using verticalsteps.

which, of course, could be bypassed by going to domainchecker. :)

 

i would like to warn or prevent WHMCS client to register .us domain while he do not have United States selected as a country.

my first thought would be to use an Additional Domain Field and use that to display warning text about the residency requirements for .us

 

I tried to add various conditions into viewcart.tpl

{if $domainvariable eq ".us"}{if $countryvariable nq "United States"}To register .us, you need to enter United States address!{/if}{/if}

I can see a few problems here... firstly, I don't think viewcart has access to the TLD individually, only the domain name(s) - so you'd possibly have to split the domain(s) to get the TLD values... not impossible and requires 3 lines of Smarty which I think i've posted here at least 3 times.

 

secondly, nq would be ne - but that would be irrelevant unless the client was logged in... if they're logged in, then you should have access to their country... if not logged in, then you need to go to the next step and checkout before identifying the country... catch-22... unless you were using some GeoIP solution, but let's not complicate this further. :roll:

 

but nothing seems to work. So i at least can do something like this:

{if $domainsinorder}<p>To register .in, .us, .eu please enter the Country that match the TLD region.</p>{/if}

But it is too general and shows for all domains.

I doubt you could do it as above... at the very least, it's an array you need to access, so you'd probably have to foreach loop through it and add an if statement inside there... it's probably going to be about ten lines of Smarty (maybe more as you won't want it to display multiple instances of the same message if there are multiple applicable domains in the cart) - though if you were using Smarty 3 (e.g v7), you could probably half that as it would be simpler, but that would require an upgrade which is a road you don't want to go down.

 

Please do you have idea regarding right condition to prevent or at least warn user when he Checkout?

as I said before, you couldn't really do this in the template unless the client was already logged in... if they're not logged in, the country used would be your default country until changed.. I suppose you could use jquery to detect a country change...

 

Note that i am not looking for a plugin, module or WHMCS upgrade.

personally, I wouldn't bother with these template changes, i'd just use Additional Domain Fields and make it crystal clear during the configuration stage about the requirements for these TLDs and that the registrations won't occur unless those conditions are met.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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