Jump to content

Domain Registration Form


roboman

Recommended Posts

When you register a domain name -

you have a box to enter the domain you wish to register

then you have click to continue button below.

 

So, I just enter andy.com since I thought andy is my name and nobody has been taken yet :)

 

Unfortunately "Unavailable" - :(

 

Well, I need to enter another name to register, but click to continue button has disappeared!

 

So, I do like this in adddomain.tpl

<div class="cartbox" align="center">www. <input type="text" name="sld" size="40" value="{$sld}" /> <select name="tld">
{foreach key=num item=listtld from=$tlds}
<option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option>
{/foreach}
</select>
 <input type="submit" value="Go">
</div>

So, I can enter another name to register than I need to go around.

 

Then, I enter another domain name again, and there also unavailable for all TLDs.

 

But Add to Cart button on the bottom is showing. I confused! I am not sure I can still add to cart. So I don't want to show this button if there nothing is availabe.

 

In the adddomain.tpl, I do edit as below:

{if $result.status eq $searchvar}
<p align="right"><input type="submit" value="{$LANG.addtocart}" />   <input type="button" value="{$LANG.viewcart}" onclick="window.location='cart.php?a=view'" /></p>
{/if}

So there no way to add to cart since nothing is available.

 

If I am wrong, please correct me.

Link to comment
Share on other sites

Hi,

Yea, this has been an issue with the cart templates I've been meaning to post about and to do an edit on the templates. It is confusing for customers when the domain they want is unavailable and even though the search box appears again, the 'search button' has disappeared.

 

They can't actually go anywhere as their only options are to 'add to cart' or 'view cart'.

 

It is not possible to search for another domain.

 

They can't even click on the 'Register Domain' option in the cart menu at the top as it is no longer live as they are already in the 'register domain' section.

 

I'm hoping to get a chance later today, now that you've highlighted it again, to look at what you've done and see if it is a solution.

 

The default templates definitely need a 'fix' for this.

 

Si

Link to comment
Share on other sites

Hi,

Tested your code and it works, partially. It needs more done to it though.

 

If you search for a domain and it is available, it is automatically ticked to be added to the shopping cart. However, the customer may want to do a few further searches before adding the domain to their shopping cart. But, when you click on the new GO button you've inserted to the right of your domain TLD drop-downs, it doesn't search for a domain, but instead performs the ADD TO CART function.

 

This does need looking at (if it hasn't been addressed already).

 

Si

Link to comment
Share on other sites

OK, found the problem.

 

Your submit button is still wrapped in the

 

<form method="post" action="{$smarty.server.PHP_SELF}?a=add&domain={$domain}">

 

so before your first piece of code you need to place

 

<form method="post" action="domainchecker.php>

 

and don't forget to close it off with a </form> at the end of the submit call.

 

Si

Link to comment
Share on other sites

Just to clarify this in simple terms. If you wish to have the search box in your search results page have the facility for the customer to perform another search, do this:

 

Open your adddomain.tpl file and find:

 

<div class="cartbox" align="center">www. <input type="text" name="sld" size="40" value="{$sld}" /> <select name="tld">
{foreach key=num item=listtld from=$tlds}
<option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option>
{/foreach}
</select>
</div>

 

replace it with:

 

</form>
<div class="cartbox" align="center">
<form action="http://yourdomain.com/whmcs/cart.php?a=add&domain=register" method="post">
<align="center">www. <input type="text" name="sld" size="40" value="{$sld}" /> <select name="tld">
{foreach key=num item=listtld from=$tlds}
<option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option>
{/foreach}
</select>
 <input type="submit" value="Go"></form>
</div>
<form method="post" action="{$smarty.server.PHP_SELF}?a=add&domain={$domain}">

 

NOTE: Replace the http://yourdomain.com/whmcs/ part with your url.

 

I've tested this and can't see any issues with it. If anyone finds anything, or has improvements, please let me and others know.

 

As always, remember to back up your original adddomain.tpl file.

 

Si

Link to comment
Share on other sites

Heads up to everyone. This needs more work and I'm up to my eyes with other stuff at the minute so if anyone wants to help, please feel free.

 

The transfer domains page doesn't work with the above as the domainchecker script is forced into the domain-register mode. It needs to be able to tell the difference.

 

Revert back to the old system until I or someone else who has more time can get looking at this in more depth.

 

Sorry and Thanks

 

Si

Link to comment
Share on other sites

Baffled. Using my own code, I can't get it to work at all. Been to your site chickendippers and can see it working perfectly well. Don't get it. I've been looking at your source code to see if there are any differences in what you've done.

 

Is the only change you've made to adddomain.tpl the one I've posted above?

Link to comment
Share on other sites

Thanks to chickendippers we have a fix.

 

Change the line

 

<form action="http://yourdomain.com/whmcs/cart.php?a=add&domain=register" method="post">

 

to

 

<form action="cart.php?a=add&domain={if $domain eq "register"}register{else}transfer{/if}" method="post">

 

Thanks chickendippers.

 

Si

Link to comment
Share on other sites

Update on this:

 

The job is much bigger than I anticipated as adddomains.tpl only affects domain transfers and domain registrations. Things get much more tricky (and messy) when it comes to the configureproductdomains.tpl

 

I've contacted Matt who has agreed to add another search button beside the search box and TLD drop-down.

 

As Matt points out, the 'add to cart' or 'click to continue' buttons which appear underneath the search results will perform another domain search if there is no domain selected and another domain is input into the search box by the customer. However, in my opinion, this is not very intuitive either on the basis that:

 

1) There is too much distance between the search box and the 'Add to Cart' or 'Click to Continue' button (search results in between)

 

and

 

2) Add to Cart and Click to Continue don't suggest to the customer that another domain search is about to be performed.

 

Hopefully whatever Matt comes up with will solve this issue and it will be better to have default template files.

 

Si

Link to comment
Share on other sites

It would be good if, when you search for a domain, and no domains are available, that the 'Add to Cart' button either didn't appear at all or was not able to be pressed.

 

Just my thoughts on perfecting this already brill system.

 

Si

Link to comment
Share on other sites

Hi,

Tested your code and it works, partially. It needs more done to it though.

 

If you search for a domain and it is available, it is automatically ticked to be added to the shopping cart. However, the customer may want to do a few further searches before adding the domain to their shopping cart. But, when you click on the new GO button you've inserted to the right of your domain TLD drop-downs, it doesn't search for a domain, but instead performs the ADD TO CART function.

 

This does need looking at (if it hasn't been addressed already).

 

Si

 

Yes you are right. What I did is I just removed

{if $result.domain|in_array:$domains} checked{/if}

 

Original was:

{foreach key=num item=result from=$availabilityresults}
<tr class="clientareatableactive"><td>{$result.domain}</td><td class="{if $result.status eq $searchvar}domaincheckeravailable{else}domaincheckerunavailable{/if}">{if $result.status eq $searchvar}<input type="checkbox" name="domains[]" value="{$result.domain}"{if $result.domain|in_array:$domains} checked{/if} /> {$LANG.domainavailable}{else}{$LANG.domainunavailable}{/if}</td><td>{if $result.regoptions}<select name="domainsregperiod[{$result.domain}]">{foreach key=num item=regoption from=$result.regoptions}<option value="{$regoption.period}">{$regoption.period} {$LANG.orderyears} @ {$currencysymbol}{$regoption.price} {$currency}</option>{/foreach}</select>{/if}</td></tr>
{/foreach}

 

After removed:

{foreach key=num item=result from=$availabilityresults}
<tr class="clientareatableactive"><td>{$result.domain}</td><td class="{if $result.status eq $searchvar}domaincheckeravailable{else}domaincheckerunavailable{/if}">{if $result.status eq $searchvar}<input type="checkbox" name="domains[]" value="{$result.domain}" /> {$LANG.domainavailable}{else}{$LANG.domainunavailable}{/if}</td><td>{if $result.regoptions}<select name="domainsregperiod[{$result.domain}]">{foreach key=num item=regoption from=$result.regoptions}<option value="{$regoption.period}">{$regoption.period} {$LANG.orderyears} @ {$currencysymbol}{$regoption.price} {$currency}</option>{/foreach}</select>{/if}</td></tr>
{/foreach}

 

Is it the soultion? Please advise.

Link to comment
Share on other sites

  • WHMCS CEO
Hi Matt,

Just bumping this thread and asking if you are making the modified template files available now, or if you are waiting until 3.6 ?

 

Thanks

 

Si

Hi,

 

You can download the two template files from the following urls:

 

http://demo.whmcs.com/templates/orderforms/cart/adddomain.tpl

http://demo.whmcs.com/templates/orderforms/cart/configureproductdomain.tpl

 

There's also two new language file strings needed:

 

$_LANG["morechoices"] = "More Choices";
$_LANG["checkavailability"] = "Check Availability";

 

Matt

Link to comment
Share on other sites

Hi,

 

Thanks Matt and all discussing for this issue.

 

I still find the "Add to Cart" button even there are no domain is available. However, with this new fixed, I found that once I click the "Add to Cart" button when no domain is available, page is refresh and come back to search the domain name again.

 

Why not we just disable the "Add to Cart" for situation of no domain available? If so, will it be correct to use this:

{if $result.status eq $searchvar}
<p align="center"><input type="submit" value="{$LANG.addtocart}" /></p>
{else}
<p align="center"><input type="submit" value="{$LANG.addtocart}" disabled="disabled" /></p>
{/if}

Link to comment
Share on other sites

Also make changes for productconfiguredomain.tpl as well...

 

<p align="center">
{if $result.status eq $searchvar}
	 <input type="submit" value="{$LANG.ordercontinuebutton}" />
	 {else}
   <input type="submit" value="{$LANG.ordercontinuebutton}" disabled="disabled" />
{/if}
</p>

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