Craft Posted November 14, 2020 Share Posted November 14, 2020 When any customer wants to purchase a new hosting package, if he wants to purchase a new domain for his hosting in the next step, he writes his domain name then he selects the TLD from a dropdown list. The issue that we have more than 500 TLDs, and all the TLDs are starting with a DOT, so the customer can't type the first letter of the TLD to filter the list. How can I remove this DOT? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 14, 2020 Share Posted November 14, 2020 5 minutes ago, Craft said: How can I remove this DOT? by changing one line in the configureproductdomain.tpl template... <option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option> to... <option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld|ltrim:'.'}</option> it shouldn't have any impact on the order process as you're just changing the label rather than the value being passed through the forms. 1 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 14, 2020 Author Share Posted November 14, 2020 (edited) 8 hours ago, brian! said: by changing one line in the configureproductdomain.tpl template... <option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option> to... <option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld|ltrim:'.'}</option> it shouldn't have any impact on the order process as you're just changing the label rather than the value being passed through the forms. Perfect, it works 🙂 This file could be changed or restored to the default when updating WHMCS to a new version? Can I add a DOT before the drop-down list? (After the text-field of the domain) Edited November 14, 2020 by Craft 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 15, 2020 Share Posted November 15, 2020 14 hours ago, Craft said: Perfect, it works 🙂 never in doubt! 🙂 14 hours ago, Craft said: This file could be changed or restored to the default when updating WHMCS to a new version? yes - updating WHMCS would overwrite this change (if the orderform theme hasn't been renamed) - but my thinking was... the order process uses the original value of $listtld, so a hook that modified those values might prevent the order process from working (it might not - but I didn't see any point in testing it). almost certainly, there will be no more v8.0 releases - and v8.1 is scheduled to include bootstrap, new client theme and updated order forms - so any hook solution that works today might not be applicable in v8.1 and if that's the case, you're no further forward by using a hook.... and I wouldn't expect 8.1 to go GA for at least four months from now. assuming a hook that modified the array would prevent successful ordering, then you're looking at using JS to loop through the dropdown and change the labels... i'll guaratee that's a lot more code than just using |ltrim:'.' in the template (and again might not work in v8.1 where who knows what sort of bizarre TLD selection choices WHMCS might come up with! 😲) which is a long winded way to suggest that you put up with editing the template for now, and then see what options are available in v8.1 if you still need/want/can do this then. 14 hours ago, Craft said: Can I add a DOT before the drop-down list? (After the text-field of the domain) I suspect that you would have to edit the existing div sizes to create the space for you to be able to do that. 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 15, 2020 Author Share Posted November 15, 2020 1 hour ago, brian! said: yes - updating WHMCS would overwrite this change (if the orderform theme hasn't been renamed) - but my thinking was... Is there an option to create a custom orderform to not be overwrite with the future updates?, same as creating a custom template rather than (six) template. 1 hour ago, brian! said: I suspect that you would have to edit the existing div sizes to create the space for you to be able to do that. Forget, it's not a big issue! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 16, 2020 Share Posted November 16, 2020 22 hours ago, Craft said: Is there an option to create a custom orderform to not be overwrite with the future updates?, same as creating a custom template rather than (six) template. there's nothing to stop you renaming/duplicating standard_cart and modifying the duplicate - the problem them comes with updates and having to compare WHMCS changes to your own custom templates. https://blog.whmcs.com/112975/customising-templates-the-easy-way 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 16, 2020 Author Share Posted November 16, 2020 3 hours ago, brian! said: there's nothing to stop you renaming/duplicating standard_cart and modifying the duplicate - the problem them comes with updates and having to compare WHMCS changes to your own custom templates. https://blog.whmcs.com/112975/customising-templates-the-easy-way Ok, and after duplicating standard_cart folder with another name, how can I choose to use the new folder instead of standard_cart? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 17, 2020 Share Posted November 17, 2020 15 hours ago, Craft said: Ok, and after duplicating standard_cart folder with another name, how can I choose to use the new folder instead of standard_cart? the same as you would with any orderform template - you would either define it as the default orderform from setup -> general settings -> ordering, and/or you would individually assign it to be used in specific product groups. 1 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 17, 2020 Author Share Posted November 17, 2020 4 hours ago, brian! said: the same as you would with any orderform template - you would either define it as the default orderform from setup -> general settings -> ordering, and/or you would individually assign it to be used in specific product groups. Got it. I created a new folder and I added these files only, is that's enough? I just need to modify this file only (configureproductdomain.tpl) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 18, 2020 Share Posted November 18, 2020 18 hours ago, Craft said: I created a new folder and I added these files only, is that's enough? I just need to modify this file only (configureproductdomain.tpl) you might need the css/js folders too. 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 18, 2020 Author Share Posted November 18, 2020 5 hours ago, brian! said: you might need the css/js folders too. Nope, because each cart of the other 7 carts are having their own css/js folders with their own custom codes. So, if we don't need to overwrite any css/js of the standard_cart, then we shouldn't create the css/js folders. Thank you 🙂 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.