hebergeni Posted November 28, 2016 Share Posted November 28, 2016 Hello I need you help to make a function so when a cctld Domain is selected on checkout i try to display a checkform TOS for costumer to accepted Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 29, 2016 Share Posted November 29, 2016 one easier option might be to use Additional Domain Fields which the customer can accept these terms during the domains configuration step of the ordering process. or you could use the existing TOS checkbox for both your Terms, and the additional ccTLD terms - optionally, you could check the cart at checkout to see if it contains a ccTLD and only display the additional text if it does. though your biggest problem with doing that might be that you will have to manually define which TLDs you consider to be ccTLDs - as WHMCS won't know that '.uk' is a ccTLD, but '.com' isn't... or that '.tv' is technically a ccTLD but marketed as a gTLD. 0 Quote Link to comment Share on other sites More sharing options...
hebergeni Posted November 30, 2016 Author Share Posted November 30, 2016 HI Brian! Thank you brian! you're helpful Regards 0 Quote Link to comment Share on other sites More sharing options...
hebergeni Posted November 30, 2016 Author Share Posted November 30, 2016 Hello It's helpful so now how can i please put this condition on checkout page instead configurationdomain page please Regards 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 30, 2016 Share Posted November 30, 2016 Hi, It's helpful so now how can i please put this condition on checkout page instead configurationdomain page please assuming you're using the standard_cart orderform template, all you should need in checkout.tpl is to change... {if $accepttos} <p> <label class="checkbox-inline"> <input type="checkbox" name="accepttos" id="accepttos" /> {$LANG.ordertosagreement} <a href="{$tosurl}" target="_blank">{$LANG.ordertos}</a> </label> </p> {/if} to... {if $accepttos} <p> <label class="checkbox-inline"> <input type="checkbox" name="accepttos" id="accepttos" /> {$LANG.ordertosagreement} <a href="{$tosurl}" target="_blank">{$LANG.ordertos}</a> {assign cctld array('.co.uk','.org.uk')} {foreach $domains as $domain} {assign tld value=$domain.domain|substr:($domain.domain|strpos:".")} {if $tld|in_array:$cctld} {assign cctldvalid TRUE} {/if} {/foreach} {if $cctldvalid} and the ccTLD Terms of Service{/if} </label> </p> {/if} if there is a ccTLD domain in the cart, then it should add the "and the ccTLD Terms of Service" text to the TOS output... if there are no ccTLDs in the cart, it will not add any additional text. there are three important things to note with this solution... 1. you will need to define your list of ccTLDs in the $cctld array.... {assign cctld array('.co.uk','.org.uk')} so if you wanted to add .uk, .nl and .be to the list, you would edit it... {assign cctld array('.co.uk','.org.uk','.uk','.be','.nl')} the order of the ccTLDs in the array does not matter. 2. if your site uses multiple languages, then you should probably replace " and the ccTLD Terms of Service" with a language string using Language Overrides. 3. you could add a link to your ccTLD Terms of Service by either adding it to the above code, or to the Language Overrides. I quickly tested the above code on v7.1 beta and it worked fine - I can't see anything in the code that would prevent it from working on v6 or v7 (unless v6 takes exception to how i've used assign, though that can be easily changed by using fuller declarations - but if it works, don't worry about doing that!). 0 Quote Link to comment Share on other sites More sharing options...
hebergeni Posted November 30, 2016 Author Share Posted November 30, 2016 HEllo Brian! Thank you a lot you're really so helpfull i will try to make a checkinbox for each TOS now Regards 0 Quote Link to comment Share on other sites More sharing options...
Sonu2007 Posted December 4, 2016 Share Posted December 4, 2016 There is any way to show full tos content instead of hyper link? may be separate page before checkout page 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.