Jump to content

Unsorted TLD's dropdown


graisbeck

Recommended Posts

Has anyone come up with a solution to the sorting of the TLD's in either the front end domain checker dropdown or the domain pricing table (as this seems to control the overall sorting of the front end dropdown)?

Even though I imported the TLD's with selling price alphabetically, the end result sorting is still random.

 

Thanks in advance.

Edited by graisbeck
Link to comment
Share on other sites

Has anyone come up with a solution to solve the sorting of the TLD's in either the front end domain checker dropdown or the domain price table (as this seems to control the overall sorting of the front end dropdown)?

Even though I imported the TLD's with selling price alphabetically, the end result sorting is so random.

the correct way to sort them would be via the domain pricing page - https://docs.whmcs.com/Domain_Pricing#Re-ordering_TLDs

  • Reordering TLDs is simply a drag & drop process
  • Position your mouse over the up/down arrows on the row you want to move, click+hold and then drag up or down
  • Once it is where you want it to be, let go of the mouse button to assign it.

SNEOF3o.png

 

that would be the best way to do it - it might take some time if you have a LOT of TLDs to resort so plump up a cushion, make yourself a cup of tea and get stuck in... in the long-run, it will beneficial to spend the time doing this. :idea:

 

but if it's time critical issue, then you can tweak it in the template with one line of Smarty... for the sake or argument, let's assume that you're using Modern and thinking specifically of the domain registration page, e.g adddomain.tpl and change...

 

                                    <select name="tld" id="inputTld" class="form-control input-lg">
                                       {foreach from=$tlds item=listtld}
                                           <option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>
                                               {$listtld}
                                           </option>
                                       {/foreach}
                                   </select>

to...

                                    <select name="tld" id="inputTld" class="form-control input-lg">
                                       {$tlds|@sort:$smarty.const.SORT_LOCALE_STRING} 
                                       {foreach from=$tlds item=listtld}
                                           <option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>
                                               {$listtld}
                                           </option>
                                       {/foreach}
                                   </select>

that method should work in all templates (including Modern, Standard_Cart and customs too).

1KqSbKe.png

 

although you could potentially resort the arrays using action hooks too, there are multiple arrays with different names used in different templates... so by the time you've covered all eventualities, you might as well have just spent the time resorting them via the domain pricing page! :idea:

 

btw - if your website is the one that i'm currently looking at and shares the name of a former Prime Minister from over a century ago(!), then I think you have a problem with your IDN TLD imports (e.g the final 7 on the dropdown) as WHMCS won't support TLDs entered in that way - do a search with them and you'll see an error message... "The domain you entered is not valid. Enter only the part after the www. and include the TLD".

 

the quick fix would just be to remove them (unless you're going to specifically target those markets), or convert them from unicode to ascii and use that in the domain pricing page.

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