Jump to content

Which variable holds the domain name user submitted?


postcd

Recommended Posts

Hello,

BACKGROUND

in WHMCS 6, i have issue with premium domains (domain is shown as available for purchase for standard price even it is premium, high priced domain)

Maybe WHMCS 7 solves the problem, but because of v. 6 plugins incompatibility with WHMCS v. 7 i want to stay with v. 6.

So as a work around i wanted to show users some notice (example if they lookup/add to cart an domain tld which may be premium) and link them to page like https://who.is/whois/theirdomain.tld to check whether it is premium (i do not know better way to prevent them ordering premium domain for standard price). I am not interested in modulesg@rden expensive modules.

WHAT I DID

I found /templates/orderforms/verticalsteps/configureproductdomain.tpl file to be responsible what is visible on the domain availability checking page: cart.php?a=add&pid=1

So i added there:

{if $smarty.session.adminid gt 0}
{* THIS IS TRIGGERED IF ADMIN X IS LOGGED IN. *}
{debug}
..
{/if}

to show various variables, i found following ones to look related to the user submitted domain name:

{$LANG.domainname}
{$result.domain}
{$incartdomain}
{$domain}

but it somehow do not print domain name.

QUESTIONS

1) Please what is right variable to print domain name on domain availability checking page (/templates/orderforms/verticalsteps/configureproductdomain.tpl ---> cart.php?a=add&pid=1)?

2) How would you solve this issue without upgrading WHMCS and cause incompatibility of v.6 plugins/modules?

Thank You

 

 

Link to comment
Share on other sites

2 hours ago, postcd said:

in WHMCS 6, i have issue with premium domains (domain is shown as available for purchase for standard price even it is premium, high priced domain)

using WHOIS, there isn't any way to consistently determine if a domain is premium or not, let alone the price.

2 hours ago, postcd said:

So as a work around i wanted to show users some notice (example if they lookup/add to cart an domain tld which may be premium) and link them to page like https://who.is/whois/theirdomain.tld to check whether it is premium (i do not know better way to prevent them ordering premium domain for standard price).

the obvious way would be to not even offer TLDs that have a premium option - that avoids all of these issues that you are currently running into (and others you may not have thought of yet!). :idea:

assuming you want to press on, then let's search for 'londonnight.club'...

eCigXeC.png

cool - it's available... except it isn't - it's PREMIUM... if you go to eNom, it's $885; go to your link above and it's $1,150.00! 9_9

now with a bit of effort, and some basic Smarty code, you could do something like this...

latjLiB.png

with the link taking you to the who.is site - though personally, I think this is a TERRIBLE idea because your customers may think that it's your site you're linking to, pay them $$$ for the domain and then believe that they've ordered it from you... not good!

to use an English expression, it would look a little naff having to rely on a 3rd-party site to determine if a domain was premium or not... if it were me as a customer, at that point I would walk away and look elsewhere to register the domain.

i've also effectively removed the link to add it to the cart, which I daresay you could put back in, though it would use the standard price.

3 hours ago, postcd said:

I am not interested in modulesg@rden expensive modules.

you might need to explore registrar module options in Marketplace depending on your current registrar - a module using the registrar's API, might be able to determine if it's premium and/or it's price - using WHOIS, you have absolutely no chance.

2 hours ago, postcd said:

1) Please what is right variable to print domain name on domain availability checking page (/templates/orderforms/verticalsteps/configureproductdomain.tpl ---> cart.php?a=add&pid=1)?

well you can ignore the $LANG option as that's just a language string, personally i'd go with $result.domain if you're intending to do this AFTER the client has searched for a domain...

if you want the (not very good!) code I quickly wrote to make the above change, i'll post it - but I don't have a v6 demo, so I did in using v6.2.2 and so I can't guarantee it would work for you..

{foreach key=num item=result from=$availabilityresults}
<tr><td>{$result.domain}</td><td class="{if $result.status eq $searchvar}textgreen{else}textred{/if}">{if $result.status eq $searchvar}{if $result.domain|strstr:'.club'}<br><b><font style="color:black;">This might be a premium domain!<br>Check <a href="https://who.is/whois/{$result.domain}">here</a> to confirm.</font></b>{elseif !$result.domain|strstr:'.club'}<input type="checkbox" name="domains[]" value="{$result.domain}"{if $num eq 0} checked{/if} /> {$LANG.domainavailable}{else}{$LANG.domainunavailable}{/if}{/if}</td><td>{if $result.regoptions}<select name="domainsregperiod[{$result.domain}]">{foreach key=period item=regoption from=$result.regoptions}{if $regoption.$domainoption}<option value="{$period}">{$period} {$LANG.orderyears} @ {$regoption.$domainoption}</option>{/if}{/foreach}</select>{/if}</td></tr>
{/foreach}

if I was doing it properly for multiple TLDs, I might be tempted to create an array of Premium TLDs, split the result domain into SLD/TLD and do an array search - but for a handful of TLDs, the above method could easily be expanded.

3 hours ago, postcd said:

2) How would you solve this issue without upgrading WHMCS and cause incompatibility of v.6 plugins/modules?

by not offering those TLDs - genuinely, that is what I would do... unless you're prepared to put the effort in to make this quaint idea work.

it's also worth remembering that VerticalSteps got removedfrom WHMCS in v6.1 - so if you're going to upgrade to v7 one day, you can forget about continuing to use Vertical Steps.

plus none of the above changes would prevent a customer registering (or trying to) a premium domain via domainchecker - so you may have to do something similar there too.

Link to comment
Share on other sites

Thank You for your detailed reply.

> a module using the registrar's API, might be able to determine if it's premium and/or it's price

but this would not work on WHMCS 6.3 only v. 7 right? I have not found any module that would do this

> {if $result.domain|strstr:'.club'}

please kindly how to match not only for one, but for following three tlds? .club, .bid, .top

Edited by postcd
Link to comment
Share on other sites

2 hours ago, postcd said:

but this would not work on WHMCS 6.3 only v. 7 right?

getting premium status/pricing is down to the registrar API and that's slightly of more critical importance than the WHMCS version you're using... off the top of my head, I can't see any reason why a module couldn't be written that uses a registrar's latest API, but needs to work on v6.

2 hours ago, postcd said:

I have not found any module that would do this

that's not surprising as it's going to be registrar-dependent and I can't remember if you ever told me which registrar you're using...

one example I can think of that would work, if you are using a Logicboxes reseller (NetEarthOne, Resell.biz, ResellerClub, Resellercamp), would be the ResellerClub-Mods LogicBoxes Compatible Domain Registrar Module - that would work for WHMCS v6 -> v7.2.2 (and probably beyond that once the author updates for v7.3) and includes Premium domain options.

but if you're not using a LB registrar, and there isn't a module in Marketplace, then you're probably looking at posting in Service Offers & Requests and paying a developer to write a custom module for you.

2 hours ago, postcd said:

please kindly how to match not only for one, but for following three tlds? .club, .bid, .top

for three TLDs, you could just expand the if statement...

{if $result.domain|strstr:'.bid' or $result.domain|strstr:'.club' or $result.domain|strstr:'.top'} 

 

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.

×
×
  • 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