roboman Posted January 24, 2008 Share Posted January 24, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 24, 2008 Share Posted January 24, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 24, 2008 Share Posted January 24, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 24, 2008 Share Posted January 24, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 24, 2008 Share Posted January 24, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted January 24, 2008 Share Posted January 24, 2008 Great fix, I hadn't even noticed it was missing! 0 Quote Link to comment Share on other sites More sharing options...
JasonO Posted January 24, 2008 Share Posted January 24, 2008 Me neither, thanks a lot 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 25, 2008 Share Posted January 25, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted January 25, 2008 Share Posted January 25, 2008 It seems to work for me: http://www.valcatohosting.com/plans/transfer 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 25, 2008 Share Posted January 25, 2008 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? 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted January 25, 2008 Share Posted January 25, 2008 I have changed the EPP code box so that it's hidden on that page, but that's it. 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 25, 2008 Share Posted January 25, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 25, 2008 Share Posted January 25, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 25, 2008 WHMCS CEO Share Posted January 25, 2008 Hi, Take a look at http://demo.whmcs.com/cart.php?a=add&domain=register and see if that's as it should be now. Matt 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 25, 2008 Share Posted January 25, 2008 Looks good to me Matt. Where do we get the tpl files? Si 0 Quote Link to comment Share on other sites More sharing options...
chickendippers Posted January 25, 2008 Share Posted January 25, 2008 Spiffing stuff Matt my good man 0 Quote Link to comment Share on other sites More sharing options...
PPH Posted January 25, 2008 Share Posted January 25, 2008 Hi, Take a look at http://demo.whmcs.com/cart.php?a=add&domain=register and see if that's as it should be now. Matt That works nice but is still confusing at the next step with an "update cart" button. Should be continue or something related? 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 26, 2008 Share Posted January 26, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 28, 2008 Share Posted January 28, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
roboman Posted January 29, 2008 Author Share Posted January 29, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
Si Posted January 29, 2008 Share Posted January 29, 2008 Hi Roboman, I think you should wait until Matt has released the official tpl files with the changes now being shown in the demo. Si 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 29, 2008 WHMCS CEO Share Posted January 29, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
roboman Posted January 30, 2008 Author Share Posted January 30, 2008 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} 0 Quote Link to comment Share on other sites More sharing options...
roboman Posted January 30, 2008 Author Share Posted January 30, 2008 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> 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 30, 2008 WHMCS CEO Share Posted January 30, 2008 Your code only works if the last domain checked in the bulk checking is available. As that's what the value of $result.status will be holding. Matt 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.