Search code examples
fieldcheckoutwhmcswhmcs-invoice-template

WHMCS Remove "Country" selector from checkout page


i work on WHMCS customizations, and want to hide Contry selector field. I tryed to comment county from template, and field are not shown, but when try to checkout, i got this error:

Please correct the following errors before continuing:
Please choose your country from the drop down box

enter image description here

This is Code from template that handle that part:

<div class="col-sm-12">
                        <div class="form-group prepend-icon">
                            <label for="inputCountry" class="field-icon" id="inputCountryIcon">
                                <i class="fa fa-globe"></i>
                            </label>
                            <select name="country" id="inputCountry" class="field"{if $loggedin} disabled="disabled"{/if}>
                                {foreach $countries as $countrycode => $countrylabel}
                                    <option value="{$countrycode}"{if (!$country && $countrycode == $defaultcountry) || $countrycode eq $country} selected{/if}>
                                        {$countrylabel}
                                    </option>
                                {/foreach}
                            </select>
                        </div>
                    </div>

and also this one:

<div class="col-sm-12">
                        <div class="form-group prepend-icon">
                            <select name="domaincontactcountry" id="inputDCCountry" class="field">
                                {foreach $countries as $countrycode => $countrylabel}
                                    <option value="{$countrycode}"{if (!$domaincontact.country && $countrycode == $defaultcountry) || $countrycode eq $domaincontact.country} selected{/if}>
                                        {$countrylabel}
                                    </option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                </div>

So my question is how to proceed with checkout without that warning?


Solution

  • For each country div add style="display:none", e.g.:

    This will hide the div but will keep default country selection.