
{if isset($RSThemes['pages'][$templatefile]) && file_exists($RSThemes['pages'][$templatefile]['fullPath'])}
    {include file=$RSThemes['pages'][$templatefile]['fullPath']}
{else}
    {include file="orderforms/$carttpl/common.tpl"}
    <div class="main-content {if $mainContentClasses}{$mainContentClasses}{/if}">
        <form 
            id="frmProductDomain"
            {if $showAdvancedSearchOptions} data-ai-search-enabled{/if}
            {if isset($RSThemes['addonSettings']['tld_cycle_switcher']) && $RSThemes['addonSettings']['tld_cycle_switcher'] == 'true'}
                action="{$WEB_ROOT}/cart.php" data-show-tld-cycle-switcher 
                {if isset($smarty.get.period)}
                    data-period="{$smarty.get.period|escape}"
                {/if}
            {/if} 
            {if isset($RSThemes['addonSettings']['product_domain_free_price']) && $RSThemes['addonSettings']['product_domain_free_price'] == 'true' && !isset($freeDomainNotAllowed) && !$freeDomainNotAllowed}
                {if isset($productinfo.freedomaintlds) && is_array($productinfo.freedomaintlds) && !empty($productinfo.freedomaintlds) && $productinfo.freedomain != ""}
                    data-product-domain-free-price='{$productinfo.freedomaintlds|json_encode}'
                    data-whmcs-free-format="{formatCurrency(0)}"
                {/if}
            {/if}>
            <input type="hidden" id="frmProductDomainPid" value="{$pid}" />
            <div class="panel panel-choose-domain">
                <div class="panel-body panel-domain-option">
                    <div class="content">
                        {if $incartdomains}
                            <label class="radio">
                                <input type="radio" class="icheck-control" name="domainoption" value="incart" id="selincart" /><span>{$LANG.cartproductdomainuseincart}</span>
                            </label>
                        {/if}
                        {if $registerdomainenabled}
                            <label class="radio">
                                <input type="radio" class="icheck-control" {if ($smarty.get.domain && $smarty.get.domain == "register") || $domainoption eq "register"}checked{/if} name="domainoption" value="register" id="selregister" /><span>{$LANG.cartregisterdomainchoice|sprintf2:$companyname}</span>
                            </label>
                        {/if}
                        {if $transferdomainenabled}
                            <label class="radio">
                                <input type="radio" class="icheck-control" {if ($smarty.get.domain && $smarty.get.domain == "transfer") || $domainoption eq "transfer"}checked{/if} name="domainoption" value="transfer" id="seltransfer" /><span>{$LANG.carttransferdomainchoice|sprintf2:$companyname}</span>
                            </label>
                        {/if}
                        {if $owndomainenabled}
                            <label class="radio">
                                <input type="radio" class="icheck-control" {if ($smarty.get.domain && $smarty.get.domain == "owndomain") || $domainoption eq "owndomain"}checked{/if} name="domainoption" value="owndomain" id="selowndomain" /><span>{$LANG.cartexistingdomainchoice|sprintf2:$companyname}</span>
                            </label>
                        {/if}
                        {if $subdomains}
                            <label class="radio">
                                <input type="radio" class="icheck-control" {if $domainoption eq "subdomain"} checked{/if} name="domainoption" value="subdomain" id="selsubdomain" /><span>{$LANG.cartsubdomainchoice|sprintf2:$companyname}</span>
                            </label>
                        {/if}
                    </div>
                </div>
                <div class="panel-body panel-domain-search panel-domain-search-{$searchBoxStyle}">
                    {if $incartdomains}
                        <div class="inline-form hidden" id="domainincart">
                            <div class="inline-form-element w-100">
                                <div class="d-flex flex-nowrap">
                                    {if ($RSThemes['pages'][$templatefile]['config']['SearchPrefix'] || $RSThemes['pages'][$templatefile]['config']['SearchPrefix'] == "1")}
                                        <div class="inline-form-prefix">
                                            <span>{$LANG.orderForm.www}</span>
                                        </div>
                                    {/if}
                                    <select class="form-control input-lg" id="incartsld" name="incartdomain">
                                        {foreach key=num item=incartdomain from=$incartdomains}
                                            <option value="{$incartdomain}">{$incartdomain}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="inline-form-element">                        
                                <button tabindex="0" class="btn btn-lg btn-block btn-primary{if $searchBoxStyle == 'primary'}-faded{/if}" type="submit">
                                    <span>{$LANG.orderForm.use}</span>
                                    <div class="loader loader-button">
                                        {if $searchBoxStyle == 'default'}
                                            {include file="$template/includes/common/loader.tpl" classes="spinner-sm"}
                                        {else}
                                            {include file="$template/includes/common/loader.tpl" classes="spinner-sm spinner-light"}
                                        {/if}
                                    </div>
                                </button>
                            </div>
                        </div>
                    {/if}
                    {if $registerdomainenabled}
                        <div class="inline-form hidden" id="domainregister">
                            {if $showAdvancedSearchOptions}
                                {include file="orderforms/$carttpl/includes/domain/ai-domain-tab.tpl"}
                                {include file="orderforms/$carttpl/includes/domain/ai-domain-search.tpl"}
                            {/if}
                            <div domain-search-standard class="{if $showAdvancedSearchOptions && $RSThemes.addonSettings.domain_search_default_classic  != 'enabled'} hidden{/if} w-100"> 
                                <div class="inline-form-element w-100">
                                    <div class="d-flex flex-nowrap">
                                        {if ($RSThemes['pages'][$templatefile]['config']['SearchPrefix'] || $RSThemes['pages'][$templatefile]['config']['SearchPrefix'] == "1")}
                                            <div class="inline-form-prefix">
                                                <span>{$LANG.orderForm.www}</span>
                                            </div>
                                        {/if}
                                        <input class="form-control input-lg" {if $showAdvancedSearchOptions && $RSThemes.addonSettings.domain_search_default_classic  != 'enabled'} disabled{/if} type="text" placeholder="{$rslang->trans('order.search_domain')}" id="registersld" value="{$sld}" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.enterDomain'}" />
                                    </div>
                                </div>
                                <div class="inline-form-element">
                                    <div class="dropdown" data-dropdown-select data-dropdown-counter>
                                        <div class="dropdown-toggle" tabindex="0" data-toggle="dropdown" href="#" aria-expanded="true" role="button">
                                            <input name="domaintld" id="registertld" type="hidden" data-dropdown-select-value value="{if $tld}{$tld}{else}{$registertlds[0]}{/if}">
                                            <div class="tld-select">
                                                <span data-dropdown-select-value-view>
                                                    {if $tld}
                                                        {$tld}
                                                    {else}
                                                        {$registertlds[0]}
                                                    {/if}	
                                                </span>
                                                <b class="caret" aria-hidden="true"></b>
                                            </div>
                                        </div>
                                        <div class="dropdown-menu dropdown-menu-search pull-right">
                                            <div class="dropdown-header input-group align-center">
                                                <i class="input-group-icon lm lm-search"></i>
                                                <input class="form-control" placeholder="Search..." type="text" data-dropdown-select-search>
                                            </div>
                                            <div class="dropdown-menu-items has-scroll" tabindex="-1" data-dropdown-select-list>
                                                {if ($RSThemes['pages'][$templatefile]['config']['tldCategorySelect'] || $RSThemes['pages'][$templatefile]['config']['tldCategorySelect'] == "1")}
                                                    {$currentActive = false}
                                                    {assign var='activeAssigned' value=false}
                                                    {if $spotlightTlds}
                                                        <div tabindex="-1" class="dropdown-menu-header">
                                                            {$LANG.featuredProduct}
                                                        </div>
                                                        {assign var='spotlightTldsList' value=[]}
                                                        {foreach from=$spotlightTlds item=spot}
                                                            {append var='spotlightTldsList' value=$spot.tld}
                                                        {/foreach}
                                                    
                                                        {if ($RSThemes['pages'][$templatefile]['config']['tldSorting'] && $RSThemes['pages'][$templatefile]['config']['tldSorting'] == "Alphabetically")}
                                                            {if !$tld}{$currentActive = $registertlds[0]}{/if}
                                                            {$tmp = asort($spotlightTldsList)}
                                                        {/if}
                                                        {foreach from=$spotlightTldsList item=currTld}
                                                            {assign var='isActive' value=false}
                                                            {if $tld && $tld == $currTld}
                                                                {assign var='isActive' value=true}
                                                            {elseif $currentActive && $currentActive == $currTld}
                                                                {assign var='isActive' value=true}   
                                                            {elseif !$tld && !$currentActive && $activeAssigned == false}
                                                                {assign var='isActive' value=true}
                                                            {/if}
                                                            <div tabindex="-1" class="dropdown-menu-item {if $isActive}active{/if}" data-value="{$currTld}">
                                                                <a tabindex="0" class="">{$currTld}</a>
                                                            </div>
                                                            {if $isActive}{assign var='activeAssigned' value=true}{/if}
                                                        {/foreach}
                                                        <div tabindex="-1" class="dropdown-menu-header">
                                                            {$LANG.networkissuestypeother}
                                                        </div>
                                                    {/if}
                                                    {if ($RSThemes['pages'][$templatefile]['config']['tldSorting'] && $RSThemes['pages'][$templatefile]['config']['tldSorting'] == "Alphabetically")}
                                                        {$tmp = asort($registertlds)}
                                                        {if !$tld}{$currentActive = $registertlds[0]}{/if}
                                                    {/if}
                                                    {foreach from=$registertlds item=listtld}
                                                        {assign var='skip' value=false}
                                                        {if isset($spotlightTldsList) && $spotlightTldsList}
                                                            {foreach from=$spotlightTldsList item=st}
                                                                {if $st == $listtld}
                                                                    {assign var='skip' value=true}
                                                                {/if}
                                                            {/foreach}
                                                        {/if}
                                                        {if !$skip}
                                                            {assign var='isActive' value=false}
                                                            {if $tld && $tld == $listtld}
                                                                {assign var='isActive' value=true}
                                                            {elseif $currentActive && $currentActive == $currTld}
                                                                {assign var='isActive' value=true}   
                                                            {elseif !$tld && !$currentActive && $activeAssigned == false}
                                                                {assign var='isActive' value=true}
                                                            {/if}
                                                            <div tabindex="-1" class="dropdown-menu-item {if $isActive}active{/if}" data-value="{$listtld}">
                                                                <a tabindex="0" class="">{$listtld}</a>
                                                            </div>	
                                                            {if $isActive}{assign var='activeAssigned' value=true}{/if}
                                                        {/if}
                                                    {/foreach}
                                                {else}
                                                    {if ($RSThemes['pages'][$templatefile]['config']['tldSorting'] && $RSThemes['pages'][$templatefile]['config']['tldSorting'] == "Alphabetically")}
                                                        {$tmp = asort($registertlds)}
                                                    {/if}
                                                    {foreach from=$registertlds item=listtld}
                                                        <div tabindex="-1" class="dropdown-menu-item {if $tld == $listtld}active{elseif $registertlds[0] == $listtld}active{/if}" data-value="{$listtld}">
                                                            <a tabindex="0" class="">{$listtld}</a>
                                                        </div>	
                                                    {/foreach}
                                                {/if}    
                                            </div>
                                            <div class="dropdown-menu-item dropdown-menu-no-data">
                                                <span class="text-info text-large">
                                                    {$LANG.norecordsfound}
                                                </span>
                                            </div>                                             
                                        </div>
                                    </div>								
                                </div>
                                <div class="inline-form-element mr-0">                        
                                    <button tabindex="0" id="btnCheckAvailability" class="btn btn-lg btn-primary{if $searchBoxStyle == 'primary'}-faded{/if}" type="submit" >
                                        <span>{$LANG.orderForm.check}</span>
                                        <div class="loader loader-button">
                                            {if $searchBoxStyle == 'primary'}
                                                {include file="$template/includes/common/loader.tpl" classes="spinner-sm"}
                                            {else}
                                                {include file="$template/includes/common/loader.tpl" classes="spinner-sm spinner-light"}
                                            {/if}
                                        </div>
                                    </button>
                                </div>
                            </div>
                        </div>
                    {/if}
                    {if $transferdomainenabled}
                        <div class="inline-form hidden" id="domaintransfer">
                            <div class="inline-form-element w-100">
                                <div class="d-flex flex-nowrap">
                                    {if ($RSThemes['pages'][$templatefile]['config']['SearchPrefix'] || $RSThemes['pages'][$templatefile]['config']['SearchPrefix'] == "1")}
                                        <div class="inline-form-prefix">
                                            <span>{$LANG.orderForm.www}</span>
                                        </div>
                                    {/if}
                                    <input class="form-control input-lg" type="text" id="transfersld" placeholder="{$rslang->trans('order.search_domain')}" value="{$sld}" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.enterDomain'}"/>
                                </div>
                            </div>
                            <div class="inline-form-element">
                                <div  class="dropdown" data-dropdown-select data-dropdown-counter>
                                    <div class="dropdown-toggle" tabindex="0" data-toggle="dropdown" href="#" aria-expanded="true" role="button">
                                        <input name="domaintld" id="transfertld" type="hidden" data-dropdown-select-value value="{if $tld}{$tld}{else}{$transfertlds[0]}{/if}">
                                        <div class="tld-select">
                                            <span data-dropdown-select-value-view>
                                                {if $tld}
                                                    {$tld}
                                                {else}
                                                    {$transfertlds[0]}
                                                {/if}	
                                            </span>
                                            <b class="caret" aria-hidden="true"></b>
                                        </div>
                                    </div>
                                    <div class="dropdown-menu dropdown-menu-search pull-right">
                                        <div class="dropdown-header input-group align-center">
                                            <i class="input-group-icon lm lm-search"></i>
                                            <input class="form-control" placeholder="Search..." type="text" data-dropdown-select-search>
                                        </div>
                                        <div class="dropdown-menu-items has-scroll" data-dropdown-select-list>
                                            {if ($RSThemes['pages'][$templatefile]['config']['tldCategorySelect'] || $RSThemes['pages'][$templatefile]['config']['tldCategorySelect'] == "1")}
                                                {assign var='activeAssigned' value=false}
                                                {$currentActive = false}
                                                {if $spotlightTlds}
                                                    <div tabindex="-1" class="dropdown-menu-header">
                                                        {$LANG.featuredProduct}
                                                    </div>
                                                    {assign var='spotlightTldsList' value=[]}
                                                    {foreach from=$spotlightTlds item=spot}
                                                        {append var='spotlightTldsList' value=$spot.tld}
                                                    {/foreach}
                                                    
                                                    {if ($RSThemes['pages'][$templatefile]['config']['tldSorting'] && $RSThemes['pages'][$templatefile]['config']['tldSorting'] == "Alphabetically")}
                                                        {$tmp = asort($spotlightTldsList)}
                                                        {if !$tld}{$currentActive = $transfertlds[0]}{/if}
                                                    {/if}
                                                    {foreach from=$spotlightTldsList item=currTld}
                                                        {assign var='isActive' value=false}
                                                        {if $tld && $tld == $currTld}
                                                            {assign var='isActive' value=true}
                                                        {elseif $currentActive && $currentActive == $currTld}
                                                            {assign var='isActive' value=true}   
                                                        {elseif !$tld && !$currentActive && $activeAssigned == false}
                                                            {assign var='isActive' value=true}
                                                        {/if}
                                                        <div tabindex="-1" class="dropdown-menu-item {if $isActive}active{/if}" data-value="{$currTld}">
                                                            <a tabindex="0" class="">{$currTld}</a>
                                                        </div>
                                                        {if $isActive}{assign var='activeAssigned' value=true}{/if}
                                                    {/foreach}
                                                    <div tabindex="-1" class="dropdown-menu-header">
                                                        {$LANG.networkissuestypeother}
                                                    </div>
                                                {/if}
                                                {if ($RSThemes['pages'][$templatefile]['config']['tldSorting'] && $RSThemes['pages'][$templatefile]['config']['tldSorting'] == "Alphabetically")}
                                                    {$tmp = asort($transfertlds)}
                                                    {if !$tld}{$currentActive = $transfertlds[0]}{/if}
                                                {/if}
                                                {foreach from=$transfertlds item=listtld}
                                                    {assign var='skip' value=false}
                                                    {if isset($spotlightTldsList) && $spotlightTldsList}
                                                        {foreach from=$spotlightTldsList item=st}
                                                            {if $st == $listtld}
                                                                {assign var='skip' value=true}
                                                            {/if}
                                                        {/foreach}
                                                    {/if}
                                                    {if !$skip}
                                                        {assign var='isActive' value=false}
                                                        {if $tld && $tld == $listtld}
                                                            {assign var='isActive' value=true}
                                                        {elseif $currentActive && $currentActive == $currTld}
                                                            {assign var='isActive' value=true}   
                                                        {elseif !$tld && !$currentActive && $activeAssigned == false}
                                                            {assign var='isActive' value=true}
                                                        {/if}
                                                        <div tabindex="-1" class="dropdown-menu-item {if $isActive}active{/if}" data-value="{$listtld}">
                                                            <a tabindex="0" class="">{$listtld}</a>
                                                        </div>	
                                                        {if $isActive}{assign var='activeAssigned' value=true}{/if}
                                                    {/if}
                                                {/foreach}
                                            {else}
                                                {if ($RSThemes['pages'][$templatefile]['config']['tldSorting'] && $RSThemes['pages'][$templatefile]['config']['tldSorting'] == "Alphabetically")}
                                                    {$tmp = asort($transfertlds)}
                                                {/if}
                                                {foreach from=$transfertlds item=listtld}
                                                <div tabindex="-1" class="dropdown-menu-item {if $tld == $listtld}active{elseif $transfertlds[0] == $listtld}active{/if}" data-value="{$listtld}">
                                                    <a tabindex="0" class="">{$listtld}</a>
                                                </div>	
                                                {/foreach}
                                            {/if} 
                                        </div>
                                        <div class="dropdown-menu-item dropdown-menu-no-data">
                                            <span class="text-info text-large">
                                                {$LANG.norecordsfound}
                                            </span>
                                        </div>       
                                    </div>	
                                </div>								
                            </div>
                            <div class="inline-form-element">                        
                                <button tabindex="0" type="submit" class="btn btn-lg btn-primary{if $searchBoxStyle == 'primary'}-faded{/if}">
                                    <span>{$LANG.orderForm.transfer}</span>
                                    <div class="loader loader-button">                                        
                                        {if $searchBoxStyle == 'primary'}
                                            {include file="$template/includes/common/loader.tpl" classes="spinner-sm"}
                                        {else}
                                            {include file="$template/includes/common/loader.tpl" classes="spinner-sm spinner-light"}
                                        {/if}
                                    </div>
                                </button>
                            </div>
                        </div>
                    {/if}
                    {if $owndomainenabled}
                        <div class="inline-form hidden" id="domainowndomain">
                            <div class="inline-form-element w-100">
                                <div class="d-flex flex-nowrap">
                                    {if ($RSThemes['pages'][$templatefile]['config']['SearchPrefix'] || $RSThemes['pages'][$templatefile]['config']['SearchPrefix'] == "1")}
                                        <div class="inline-form-prefix">
                                            <span>{$LANG.orderForm.www}</span>
                                        </div>
                                    {/if}
                                    <input type="text" id="owndomainsld" value="{$sld}" placeholder="{$LANG.yourdomainplaceholder}" class="form-control input-lg" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.enterDomain'}" />
                                </div>
                            </div>
                            <div class="inline-form-element">
                                <input type="text" id="owndomaintld" value="{$tld|substr:1}" placeholder="{$LANG.yourtldplaceholder}" class="form-control input-lg" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.required'}" />
                            </div>
                            <div class="inline-form-element">                        
                                <button tabindex="0" type="submit" class="btn btn-lg btn-primary{if $searchBoxStyle == 'primary'}-faded{/if}">
                                    <span>{$LANG.orderForm.use}</span>
                                    <div class="loader loader-button">
                                        {include file="$template/includes/common/loader.tpl" classes="spinner-sm spinner-light"}  
                                    </div>
                                </button>
                            </div>
                        </div>
                    {/if}
                    {if $subdomains}
                        <div class="inline-form hidden" id="domainsubdomain">
                            <div class="inline-form-element w-100">
                                <div class="d-flex flex-nowrap">
                                    {if ($RSThemes['pages'][$templatefile]['config']['SearchPrefix'] || $RSThemes['pages'][$templatefile]['config']['SearchPrefix'] == "1")}
                                        <div class="inline-form-prefix">
                                            <span>{$LANG.orderForm.www}</span>
                                        </div>
                                    {/if}
                                    <input type="text" id="subdomainsld" value="{$sld}" placeholder="yourname" class="form-control input-lg" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.enterDomain'}" />
                                </div>
                            </div>
                            <div class="inline-form-element">
                                <div  class="dropdown" data-dropdown-select data-dropdown-counter>
                                    <div class="dropdown-toggle" tabindex="0" data-toggle="dropdown" href="#" aria-expanded="true" role="button">
                                        <input name="domaintld" id="subdomaintld" type="hidden" data-dropdown-select-value value="{if $sld}{$sld}{else}{$subdomains[0]}{/if}">
                                        <div class="tld-select">
                                            <span data-dropdown-select-value-view>
                                                {if $sld}
                                                    {$sld}
                                                {else}
                                                    {$subdomains[0]}
                                                {/if}
                                            </span>
                                            <b class="caret" aria-hidden="true"></b>
                                        </div>
                                    </div>
                                    <div class="dropdown-menu dropdown-menu-search pull-right ps">
                                        <div class="dropdown-header input-group align-center">
                                            <i class="input-group-icon lm lm-search"></i>
                                            <input class="form-control" placeholder="{$LANG.search}..." type="text" data-dropdown-select-search>
                                        </div>
                                        <div class="nav-divider">
                                            <a tabindex="0" href="">
                                                -----
                                            </a>
                                        </div>
                                        <div class="dropdown-menu-items" data-dropdown-select-list>
                                            {foreach $subdomains as $subid => $subdomain}
                                                <div class="dropdown-menu-item" data-value="{$subdomain}">
                                                    <a tabindex="0" tabindex="0">{$subdomain}</a>
                                                </div>
                                            {/foreach}
                                        </div>
                                        <div class="dropdown-menu-item dropdown-menu-no-data">
                                            <span class="text-info text-large">
                                                {$LANG.norecordsfound}
                                            </span>
                                        </div>
                                        <div class="ps__rail-x">
                                            <div class="ps__thumb-x" tabindex="0"></div>
                                        </div>
                                        <div class="ps__rail-y">
                                            <div class="ps__thumb-y" tabindex="0"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="inline-form-element">                        
                                <button tabindex="0" type="submit" class="btn btn-lg btn-primary{if $searchBoxStyle == 'primary'}-faded{/if}">
                                    <span>{$LANG.orderForm.check}</span>
                                    <div class="loader loader-button">
                                        {if $searchBoxStyle == 'primary'}
                                            {include file="$template/includes/common/loader.tpl" classes="spinner-sm"}
                                        {else}
                                            {include file="$template/includes/common/loader.tpl" classes="spinner-sm spinner-light"}
                                        {/if} 
                                    </div>
                                </button>
                            </div>
                        </div>
                    {/if}
                </div>
            </div>
            {if $freedomaintlds}
                {if isset($RSThemes['addonSettings']['product_domain_free_price']) && $RSThemes['addonSettings']['product_domain_free_price'] == 'true'}
                    <div class="message message-free-domain">
                        <h4 class="message-title"><i class="lm lm-globe-alt"></i>{$rslang->trans('order.free_domain_terms.title')}</h4>                    
                        <ul class="message-desc">
                            {if is_array($productinfo.freedomaintlds) && !empty($productinfo.freedomaintlds)}
                                <li><span>{$LANG.orderfreedomainappliesto|@ucfirst}:</span>
                                    {foreach $productinfo.freedomaintlds as $key => $freeTld}
                                        {if $key <= 20}
                                            <span class="label label-sm label-default">{$freeTld}</span>
                                        {elseif $key == 21}
                                            <span class="more-tld label label-sm label-primary-faded" data-toggle="popover" data-bs-custom-class="sdadsa" data-placement="top" data-content="<div class='popover-tld-container'><p class='popover-tld-title p-sm'>Other Extensions List</p>{foreach $productinfo.freedomaintlds as $key => $freeTld}{if $key >= 21}<span class='popover-tld-item label label-sm label-default'>{$freeTld|replace:".":" ." }</span>{/if}{/foreach}</div>">+{count($productinfo.freedomaintlds) - 20}</span>
                                        {/if}
                                    {/foreach}
                                </li>
                            {/if}
                            {if is_array($productinfo.freedomainpaymentterms) && !empty($productinfo.freedomainpaymentterms)}<li><span>{$rslang->trans('order.free_domain_terms.available_for_cycles')}:</span>{foreach $productinfo.freedomainpaymentterms as $paymentterm}{$langkey = "orderpaymentterm`$paymentterm`"}<span class="label label-sm label-default">{$LANG.$langkey}</span>{/foreach}</li>{/if}
                            <li>{$rslang->trans('order.free_domain_terms.one_type_product')}</li>
                       </ul> 
                    </div>
                {else}
                    <p class="domain-suggestions-warning">* {$LANG.orderfreedomainregistration} {$LANG.orderfreedomainappliesto}: {$freedomaintlds}</p>
                {/if}
            {/if}
        </form>
        {* <div id="primaryLookupSearching" class="domain-lookup-loader message message-lg message-no-data hidden">
            <div class="loader">
                {include file="$template/includes/common/loader.tpl"}  
            </div>
        </div>*}   
        <form method="post" action="{$WEB_ROOT}/cart.php?a=add&pid={$pid}&domainselect=1" id="frmProductDomainSelections">
            {if (!$RSThemes['pages'][$templatefile]['config']['showContinueButton'] || $RSThemes['pages'][$templatefile]['config']['showContinueButton'] == "0")}
                {if $smarty.get.billingcycle}
                    <input type="hidden" name="billingcycle" value="{$smarty.get.billingcycle|escape}" />
                {/if}
                {if $smarty.get.addons}
                    {foreach $smarty.get.addons as $key => $addons}
                        <input type="hidden" name="addons[{$key}]" value="1" />
                    {/foreach}
                {/if}
                
                {if $smarty.get.configoption}
                    {foreach $smarty.get.configoption as $key => $cf}
                        <input type="hidden" name="configoption[{$key}]" value="{$cf}" />
                    {/foreach}
                {/if}
                {if $smarty.get.skipconfig && $smarty.get.skipconfig == "1"}
                    <input type="hidden" name="skipconfig" value="1" />
                {/if}
            {/if}
            <input type="hidden" id="resultDomainOption" name="domainoption" />
            <input type="hidden" id="resultDomain" name="domains[]" />
            <input type="hidden" id="resultDomainPricingTerm" />
            <div id="DomainSearchResults" class="hidden" data-scroll-to-results="true">
                <div id="searchDomainInfo" class="domain-checker-result-headline">
                    <div id="primaryLookupResult" {if $isBundle || $RSThemes['pages'][$templatefile]['config']['showContinueButton'] == "1"}data-product-bundle{/if} {if $sld && $tld && $RSThemes['pages'][$templatefile]['config']['automaticallyAddViaExternalLink'] == "1"}data-add-to-cart-on-search{/if}>
                        {include file="orderforms/$carttpl/includes/domain/search-result.tpl" configProductDomain="true"}
                    </div>
                </div>
                <div class="section domain-lookup-message domain-lookup-suggestions-message">
                    <div class="section-header">
                        <h2 class="section-title">{lang key='orderForm.suggestedDomains'}</h2>        
                        <p class="section-desc">{lang key='domainssuggestionswarnings'}</p>
                    </div>
                    <div class="section-body">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                {include file="$template/assets/img/aisearch-icon.svg"}
                                <div class="d-flex flex-column">
                                    <h6 class="mb-2 text-center">{$rslang->trans('domains.ai_search.no_data_title')}</h6>
                                    <p class="mb-0 text-center">{$rslang->trans('domains.ai_search.no_data_description')}</p>
                                </div>
                                <button class="btn btn-sm btn-default" type="button" data-reset-domain-search-button>{$rslang->trans('domains.ai_search.reset_search')}</button>
                            </div>
                        </div>
                    </div>
                </div>
                {if $registerdomainenabled}
                    {if $spotlightTlds}
                        {include file="orderforms/$carttpl/includes/domain/spotlight.tpl" configProductDomain="true"}
                    {/if}
                    {include file="orderforms/$carttpl/includes/domain/suggested.tpl" configProductDomain="true"}
                {/if}
            </div>
            {include file="orderforms/$carttpl/includes/domain/bottom-sticky.tpl" type="productdomian"}
            
        </form>
    </div>
    {include file="orderforms/$carttpl/includes/recommendations-modal.tpl"}
    <script>
        jQuery(document).ready(function() {
            {if $sld && $tld}
                {literal}
                    setTimeout(function(){
                        let button = $('.panel-domain-search .inline-form:not(hidden) button');
                        jQuery(button).trigger('click');
                    }, 500);
                {/literal}  
            {/if}
            /*{literal}
            jQuery(document).ready(function() {
                var isRTL = jQuery('html').attr('dir') === 'rtl' ||
                    jQuery('body').attr('dir') === 'rtl' ||
                    document. documentElement.dir === 'rtl';

                if (isRTL) {
                    jQuery('select#incartsld option').each(function() {
                        var domain = jQuery(this).text().trim();
                        var parts = domain.split('.');

                        if (parts. length === 2) {
                            var reversed = parts[1] + '.' + parts[0];
                            jQuery(this).text(reversed);
                        }
                        else if (parts.length > 2) {
                            var reversed = parts. reverse().join('.');
                            jQuery(this).text(reversed);
                        }
                    });
                }
            });
            {/literal}*/

        });
    </script>   
{/if}