<script src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/select2.min.js"></script>
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/main.min.js?v={$versionHash}"></script>

<script>
	window.cartempty = "{lang key='cartempty'}";
	window.domainrequired = "{lang key='domaincheckerchoosedomain'}";
	window.productrequired = "{lang key='upgradedowngradechooseproduct'}";
	window.domainLengthRequirements = "{lang key='ordererrordomaininvalid'}";
	window.isrequired = "&nbsp;{lang key='clientareaerrorisrequired'}";
</script>

{if $ordertype == 'global'}
<script>
	jQuery(document).ready(function () {
		recalcsummary();
        if (jQuery('#hiddenpromo').val().trim() != '') {
            jQuery('#promocode').val(jQuery('#hiddenpromo').val());
            jQuery('.applypromo').trigger('click');
			jQuery('.promo_form').show();
			jQuery('.promo_text').remove();
            setTimeout(function(){ recalcheckout(); }, 1000);
            
        }else{
            recalcheckout();
        }
        
		{if $pid}jQuery('#pid_{$pid}').trigger('click');{/if}
		{if $pid}jQuery('#apid_{$pid}').removeClass('hidden');{/if}
		{if $domainorder == 'transfer'}jQuery(".domain-trans").trigger("click");{/if}
	
	});
	var ccdordertype = 'all';
    {if $domainorder == 'register'}
		ccdordertype = 'register';
    {/if}
    {if $domainorder == 'transfer'}
		ccdordertype = 'transfer';
    {/if}
</script>

{if $themesettings.orderform.opcnoheader}
<div class="hero spc">
    <div class="container">
		<div class="logo-section">
			<a class="logo" href="{if $themesettings.headersetting.CustomLogoLink}{$themesettings.headersetting.CustomLogoLink}{else}{$WEB_ROOT}/{/if}">
				{if $themesettings.general.enablelogo}
					<img src="{$themesettings.general.logourl}" alt="{$companyname}" class="logo-light" />
					{if $themesettings.general.darklogo}
						<img src="{$themesettings.general.darklogo}" alt="{$companyname}" class="logo-dark" />
					{else}
					<span class="logo-dark">{$companyname}</span>
					{/if}
				{else}
					<span class="logo-light">{$companyname}</span>
				{/if}
			</a>
		</div>
    </div>
</div>
{else}
{if $themesettings.general.bannerstyle}
<div{if $themesettings.general.bsbgstyle eq "1"} class="small-header header-banner-styled bg-primary position-relative mb-5"{else} class="hero-bg-wrap small-header header-banner-styled inverse bg-opacity mb-5"{if $themesettings.general.bheaderbg} style="background-image:url('{$themesettings.general.bheaderbg}');"{/if}{/if}>
	{if $themesettings.general.bsbgstyle eq "1"}
		<div class="cros-bg-shapes-right"></div>
		<div class="cros-bg-shapes-left"></div>
	{/if}    
	<div class="container">
		<div class="page-title position-relative">
			<div class="header-lined">
				{if $domainorder == 'register'}
					<div>
						<h1 class="fw-900">{lang key="registerdomain"}</h1>
						<span class="d-none d-sm-block">{lang key="registerdomaindesc"}</span>
					</div>
				{elseif $domainorder == 'transfer'}
					<div>
						<h1 class="fw-900">{lang key="transferdomain"}</h1>
						<span class="d-none d-sm-block">{lang key="orderForm.transferExtend"}</span>
					</div>
				{else}
					<h1 class="fw-900">{lang key="carttitle"}</h1>
				{/if}
			</div>
		</div>
    </div>
</div>
{else}
<div class="hero d-flex align-items-center no-padding-bottom">
    <div class="container">
        <div class="page-title">
			<div class="header-lined">
				{if $domainorder == 'register'}
					<div>
						<h1 class="fw-900">{lang key="registerdomain"}</h1>
					</div>
					<div>
						<p class="d-none d-sm-block">{lang key="registerdomaindesc"}</p>
					</div>
				{elseif $domainorder == 'transfer'}
					<div>
						<h1 class="fw-900">{lang key="transferdomain"}</h1>
					</div>
					<div>
						<p class="d-none d-sm-block">{lang key="orderForm.transferExtend"}</p>
					</div>
				{else}
					<h1 class="fw-900">{lang key="carttitle"}</h1>
				{/if}
			</div>
		</div>
    </div>
</div>
{/if}
{/if}

<div id="order-standard_cart">
    <input type="hidden" value="{$promocode}" id="hiddenpromo"/>
    <div class="cat-loader" style="display: none;">
        <div class="loader-icon">
            <i class="fad fa-circle-notch fa-spin fa-3x"></i>
        </div>
    </div>
    <div class="container">
        <div class="onepage_cart" id="onepage_cart">
            <div class="row ajaxcart_cont">
                <div class="col-lg-8 col-xl-9">
				
                    <span class="d-block d-lg-none float-right">
                        <a href="{$WEB_ROOT}/order.php{if $domainorder == 'register'}?domainaction=register{elseif $domainorder == 'transfer'}?domainaction=transfer{/if}" onclick="emptyCart()" class="btn btn-link btn-emptycart" data-toggle="tooltip" data-placement="top" title="{$LANG.emptycart}"><i class="fas fa-trash"></i> {$LANG.emptycart}</a>
                     </span>
					<div class="clearfix"></div>
					
                    <form id="coniguration_form" onsubmit="return false;">
                        <div class="p_error" style="display: none;"></div>
                        {if $domainorder == 'all'}
                            <div class="TM-card blocks products{if $themesettings.orderform.opcpab}{if $smarty.get.pid || $smarty.get.billingcycle} hidden{/if}{/if}"> 
                                <div class="blocks_heading">
                                    <div>
                                        <label>
                                            <input class="no-icheck ortype no-radio" {if $ordertype != 'domain'}checked="checked"{/if} name="ortype" type="radio" value="productdomain">
                                            <span class="scheck no-icon"><h6 class="h4 fw-500">&nbsp;{$LANG.orderchooseapackage}</h6></span>
                                        </label>
                                    </div>
									{if $themesettings.orderform.opcnoheader || $themesettings.headersetting.accountactionbtn && !$loggedin}
										{if $languagechangeenabled && count($locales) > 1 || $currencies}
											<div class="lang-btn text-lg-right">
												<button type="button" class="text-base btn px-1 py-0" data-toggle="modal" data-target="#modalChooseLanguage">
													{if $languagechangeenabled && count($locales) > 1}
													<div class="d-inline-block align-middle">
														<div class="iti-flag {if $activeLocale.countryCode === '001'}us{else}{$activeLocale.countryCode|lower}{/if}"></div>
													</div>
													{$activeLocale.localisedName}{/if}{if $languagechangeenabled && count($locales) > 1 && $currencies && !$loggedin}&nbsp;|&nbsp;{/if}{if !$loggedin && $currencies}{$activeCurrency.prefix} {$activeCurrency.code}{/if}
												</button>
											</div>
										{/if}
									{/if}
                                </div>
                                <div class="blocks_body productsbody" {if $ordertype == 'domain'}style="display:none;"{/if}>
									<div class="padding-all no-padding-bottom">	
                                        <div class="groups_sec">
											<select name="gid" onchange="getProducts()" id="gid" class="form-control select2-single">
												<optgroup label="{$LANG.ordercategories}">
													{foreach from=$productgroups key=num item=group}
														{if !$group.hidden}
															<option value="{$group.id}" {if $gid eq $group.id}selected="selected"{/if}>{$group.name}</option>
														{/if}
													{/foreach}
												</optgroup>
											</select>											
                                        </div>
                                    </div>

                                    <div class="space-16"></div>
									
									{if $smarty.get.pid}
                                    <div class="product_list border-top" id="product_body">
										<div class="plan-list-slider row row-eq-height flex-nowrap mx-0">
										   {foreach from=$products key=num item=product}
											<div class="{if $num eq 0}empty_p {/if}col-12 px-1 tns-item hidden" id="apid_{$product.id}">
												<label for="pid_{$product.id}">
                                                    <input type="radio" data-availableorder='{if $product.extra.stockcontrol == '1' &&  $product.extra.qty == '0'}0{else}1{/if}' {if $product.extra.freedomain !== ''}data-freedomain='{$product.extra.freedomain}'{/if} {if isset($product['ismarketconnect']) && $product['ismarketconnect'] !== ''}data-ismarketconnect='1'{else}data-ismarketconnect='0'{/if} data-havedomain='{if $product.showdomainoptions}1{else}0{/if}' {if $product.extra.subdomain != ''}data-havesubdomain='1' data-subdomains='{$product.extra.subdomain}'{else}data-havesubdomain='0' {/if} class="no-icheck no-radio domaincheckhaveit" name="pid" {if $pid eq $product.id}checked="checked"{/if} value="{$product.id}" id="pid_{$product.id}" onclick="addToCart(); triggerProduct();"/>
													<span class="scheck products-radio">
													
													   <h6 class="h5">{$product.name}</h6>
													   {if $themesettings.orderform.opcproductdesc}
														   {if $product.extra.description}
																{if $product.extra.description.features|@count > '0'}
																	{if $product.extra.description.featuresdesc}
																		<div class="smalldesc">
																			{$product.extra.description.featuresdesc}
																		</div>
																	{/if}
																	<ul class="features"> 
																		{foreach from=$product.extra.description.features key=desckey item=descvalue}
																			<li><b>{$descvalue}</b> {$desckey}</li>
																		{/foreach}									  						
																	</ul>

																{else}
																	{if $product.extra.description.original}
																		<div class="description">
																			{$product.extra.description.original}
																		</div>
																	{/if}																
																{/if}
															{/if}
														{/if}
														
													</span>
												</label>
                                                {if $product.extra.freedomainpaymentterms !== ''}
                                                <input type="hidden" name="freedomainpaymentterms" id="freedomainpaymentterms{$product.id}" value="{$product.extra.freedomainpaymentterms}">
                                                {assign var=freedomainpaymentterms value=$product.extra.freedomainpaymentterms}
                                                {/if}
                                                {if $product.extra.freedomaintlds !== ''}
                                                <input type="hidden" name="freedomaintlds" id="freedomaintlds{$product.id}" value="{$product.extra.freedomaintlds}">
                                                {assign var=freedomaintlds value=$product.extra.freedomaintlds}
                                                {/if}    
                                                {if $product.extra.freedomaintlds !==''}                                            
                                                    {assign var=freedomainvar value=$product.extra.freedomain}
                                                {/if}
											</div>
										   {/foreach}
									   </div>
                                    </div>
									{else}
                                    <div class="product_list border-top" id="product_body">
									
									   <div class="swiper-nav">
											<div class="swiper-button-prev"></div>
											<div class="swiper-pagination"></div>
											<div class="swiper-button-next"></div>
										</div>
										
										<div class="plan-list-slider swiper">
											<div class="swiper-wrapper row row-eq-height flex-nowrap mx-0">
											   {foreach from=$products key=num item=product}
											   {if $product.extra.hidden neq "0" || $product.extra.retired neq "0"}
											   {else}
												<div class="col-12 col-md-6 col-lg-6 col-xl-4 px-1 tns-item products-slide{if $num eq 0} empty_p{/if}">
													<label for="pid_{$product.id}">
														<input type="radio" {if isset($product['ismarketconnect']) && $product['ismarketconnect'] !== ''}data-ismarketconnect='1'{else}data-ismarketconnect='0'{/if} {if $product.extra.freedomain !== ''}data-freedomain='{$product.extra.freedomain}'{/if} data-havedomain='{if $product.showdomainoptions}1{else}0{/if}' {if $product.extra.subdomain != ''}data-havesubdomain='1' data-subdomains='{$product.extra.subdomain}'{else}data-havesubdomain='0' {/if} class="no-icheck no-radio domaincheckhaveit" name="pid" {if $pid eq $product.id}checked="checked"{/if} value="{$product.id}" id="pid_{$product.id}" data-availableorder='{if $product.extra.stockcontrol == '1' &&  $product.extra.qty == '0'}0{else}1{/if}' onclick="addToCart(); triggerProduct();"/>
														<span class="scheck products-radio justify-content-start h-100">
														
														   <h6 class="h5">{$product.name}</h6>
														   {if $themesettings.orderform.opcproductdesc}
															   {if $product.extra.description}
																	{if count($product.extra.description.features) > 0}
																		{if $product.extra.description.featuresdesc}
																			<div class="smalldesc">
																				{$product.extra.description.featuresdesc}
																			</div>
																		{/if}
																		<ul class="features"> 
																			{foreach from=$product.extra.description.features key=desckey item=descvalue}
																				<li><b>{$descvalue}</b> {$desckey}</li>
																			{/foreach}									  						
																		</ul>

																	{else}
																		{if $product.extra.description.original}
																			<div class="description">
																				{$product.extra.description.original}
																			</div>
																		{/if}																
																	{/if}
																{/if}
															{/if}
															
														</span>
													</label>
													{if $product.extra.freedomainpaymentterms !== ''}
													<input type="hidden" name="freedomainpaymentterms" id="freedomainpaymentterms{$product.id}" value="{$product.extra.freedomainpaymentterms}">
													{assign var=freedomainpaymentterms value=$product.extra.freedomainpaymentterms }
													{/if}
													{if $product.extra.freedomaintlds !== ''}
													<input type="hidden" name="freedomaintlds" id="freedomaintlds{$product.id}" value="{$product.extra.freedomaintlds}">
													{assign var=freedomaintlds value=$product.extra.freedomaintlds }
													{/if}    
													{if $product.extra.freedomaintlds !==''}                                            
														{assign var=freedomainvar value=$product.extra.freedomain }
													{/if}
												</div>
												{/if}
											   {/foreach}
										   </div>
										   
									   </div>
                                    </div>
									{/if}
                                </div>
                            </div>
							
							<div class="alert alert-danger" style="margin: 5px;display: none" id="outofstock">
								{lang key='outofstockdescription'}
							</div>
							
                            <div class="blocks products_billingcycle{if $themesettings.orderform.opcpab}{if $smarty.get.billingcycle} hidden{/if}{/if}" id="products-billingcycle" style="display:none;">
                                <div class="blocks_body productsbody products_billing_block">
                                    <div class="no-padding-bottom" style="font-size: 0;">
                                        {foreach from=$products key=num item=product}                                       

                                            {if $product.paytype eq 'onetime' || $product.paytype eq 'free' || $product.pricing|@count <= '1'}
                                                    <input type="hidden" name="billingcycle[{$product.id}]" value="monthly">
                                            {else}
                                                <div class="row div_billingcyle" style="display:none;" id="billingcycle_{$product.id}">
                                                    {foreach from=$product.pricing item=pricing}
                                                    {if isset($smarty.get.billingcycle)}                                                    
                                                        {$BACKCART['products'][0]['billingcycle'] = ""}
                                                        {$pricing.checked = ""}
                                                    {/if}                                                    
                                                        {if $pricing.monthly}
                                                            <div class="col-sm-4">
                                                                <div class="form-group">
                                                                    <label>                                                                 
                                                                        <input type="radio" class="cros-checkbox no-icheck" id="monthly{$product.id}" name="billingcycle[{$product.id}]" value="monthly" onclick="addToCart();triggerBillingCycle();" {if $BACKCART['products'][0]['pid'] == $product.id && $BACKCART['products'][0]['billingcycle'] == 'monthly'} checked='checked'{elseif $smarty.get.billingcycle=='monthly'} checked='checked'{elseif $pricing.checked} checked='checked'{/if}>
                                                                        <span class="pcb xs">
                                                                            <span class="c-name">{$LANG.orderpaymenttermmonthly}</span>
                                                                            <span class="c-price{if $pricing.rawmonthly eq "0"} d-none{/if}">{$pricing.monthly}</span>
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                            </div>                          
                                                        {elseif $pricing.quarterly}
                                                            <div class="col-sm-4">
                                                                <div class="form-group">
                                                                    <label>
                                                                        <input type="radio" class="cros-checkbox no-icheck" id="quarterly{$product.id}" name="billingcycle[{$product.id}]" value="quarterly" onclick="addToCart();triggerBillingCycle();" {if $BACKCART['products'][0]['pid'] == $product.id && $BACKCART['products'][0]['billingcycle'] == 'quarterly'} checked='checked'{elseif $smarty.get.billingcycle=='quarterly'} checked='checked'{elseif $pricing.checked} checked='checked'{/if}>
                                                                        <span class="pcb xs">
                                                                            <span class="c-name">{$LANG.orderpaymenttermquarterly}</span>
                                                                            <span class="c-price{if $pricing.rawquarterly eq "0"} d-none{/if}">{if $CONFIG.ProductMonthlyPricingBreakdown eq "on"}{$pricing.textprice}{else}{$pricing.quarterly}{/if}</span>
                                                                            {if $pricing.savetext}<span class="c-save">{$pricing.savetext}</span>{/if}
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                            </div>                                                        
                                                        {elseif $pricing.semiannually}
                                                            <div class="col-sm-4">
                                                                <div class="form-group">
                                                                    <label>
                                                                        <input type="radio" class="cros-checkbox no-icheck" id="semiannually{$product.id}" name="billingcycle[{$product.id}]" value="semiannually" onclick="addToCart();triggerBillingCycle();" {if $BACKCART['products'][0]['pid'] == $product.id && $BACKCART['products'][0]['billingcycle'] == 'semiannually'} checked='checked'{elseif $smarty.get.billingcycle=='semiannually'} checked='checked'{elseif $pricing.checked} checked='checked'{/if}>
                                                                        <span class="pcb xs">
                                                                            <span class="c-name">{$LANG.orderpaymenttermsemiannually}</span>
                                                                            <span class="c-price{if $pricing.rawsemiannually eq "0"} d-none{/if}">{if $CONFIG.ProductMonthlyPricingBreakdown eq "on"}{$pricing.textprice}{else}{$pricing.semiannually}{/if}</span>
                                                                            {if $pricing.savetext}<span class="c-save">{$pricing.savetext}</span>{/if}
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                            </div>                                                        
                                                        {elseif $pricing.annually}
                                                            <div class="col-sm-4">
                                                                <div class="form-group">
                                                                    <label>
                                                                        <input type="radio" class="cros-checkbox no-icheck"  id="annually{$product.id}" name="billingcycle[{$product.id}]" value="annually" onclick="addToCart();triggerBillingCycle();" {if $BACKCART['products'][0]['pid'] == $product.id && $BACKCART['products'][0]['billingcycle'] == 'annually'} checked='checked'{elseif $smarty.get.billingcycle=='annually'} checked='checked'{elseif $pricing.checked} checked='checked'{/if}>
                                                                        <span class="pcb xs">
                                                                            <span class="c-name">{$LANG.orderpaymenttermannually}</span>
                                                                            <span class="c-price{if $pricing.rawannually eq "0"} d-none{/if}">{if $CONFIG.ProductMonthlyPricingBreakdown eq "on"}{$pricing.textprice}{else}{$pricing.annually}{/if}</span>
                                                                            {if $pricing.savetext}<span class="c-save">{$pricing.savetext}</span>{/if}
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                            </div>                                                        
                                                        {elseif $pricing.biennially}
                                                            <div class="col-sm-4">
                                                                <div class="form-group">
                                                                    <label>
                                                                        <input type="radio" class="cros-checkbox no-icheck" id="biennially{$product.id}" name="billingcycle[{$product.id}]" value="biennially" onclick="addToCart();triggerBillingCycle();" {if $BACKCART['products'][0]['pid'] == $product.id && $BACKCART['products'][0]['billingcycle'] == 'biennially'} checked='checked'{elseif $smarty.get.billingcycle=='biennially'} checked='checked'{elseif $pricing.checked} checked='checked'{/if}>
                                                                        <span class="pcb xs">
                                                                            <span class="c-name">{$LANG.orderpaymenttermbiennially}</span>
                                                                            <span class="c-price{if $pricing.rawbiennially eq "0"} d-none{/if}">{if $CONFIG.ProductMonthlyPricingBreakdown eq "on"}{$pricing.textprice}{else}{$pricing.biennially}{/if}</span>
                                                                            {if $pricing.savetext}<span class="c-save">{$pricing.savetext}</span>{/if}
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                            </div>                                                        
                                                        {elseif $pricing.triennially}
                                                            <div class="col-sm-4">
                                                                <div class="form-group">
                                                                    <label>
                                                                        <input type="radio" class="cros-checkbox no-icheck" id="triennially{$product.id}" name="billingcycle[{$product.id}]" value="triennially" onclick="addToCart();triggerBillingCycle();" {if $BACKCART['products'][0]['pid'] == $product.id && $BACKCART['products'][0]['billingcycle'] == 'triennially'} checked='checked'{elseif $smarty.get.billingcycle=='triennially'} checked='checked'{elseif $pricing.checked} checked='checked'{/if}>
                                                                        <span class="pcb xs">
                                                                            <span class="c-name">{$LANG.orderpaymenttermtriennially}</span>
                                                                            <span class="c-price{if $pricing.rawtriennially eq "0"} d-none{/if}">{if $CONFIG.ProductMonthlyPricingBreakdown eq "on"}{$pricing.textprice}{else}{$pricing.triennially}{/if}</span>
                                                                            {if $pricing.savetext}<span class="c-save">{$pricing.savetext}</span>{/if}
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                            </div>                                                        
                                                        {/if}
                                                    {/foreach}
                                                </div>
                                            {/if}
                                        {/foreach}
                                    </div>
                                </div>
                            </div>

                        {/if}
                        <div class="domain_error" style="display: none;"></div>
                        {if $CONFIG.AllowRegister == 'on' || $CONFIG.AllowTransfer == 'on' || $CONFIG.AllowOwnDomain == 'on'}
                            <div class="TM-card blocks domain_cont domainareadata" {if $domainorder == 'all'} style="display: none;" {else}style="display: block;"{/if}>
                                <div class="blocks_heading">
                                    <div>
										<h2>{$LANG.cartproductdomainchoose}{if $domainorder != 'all'}<a href="order.php" class="btn btn-xs small text-danger">{$LANG.cartdomainsnohosting}</a>{/if}</h2>
									</div>
									{if $domainorder == 'register' || $domainorder == 'transfer'}
										{if $themesettings.orderform.opcnoheader || $themesettings.headersetting.accountactionbtn && !$loggedin}
											{if $languagechangeenabled && count($locales) > 1 || $currencies}
												<div class="lang-btn text-lg-right">
													<button type="button" class="text-base btn px-1 py-0" data-toggle="modal" data-target="#modalChooseLanguage">
														{if $languagechangeenabled && count($locales) > 1}
														<div class="d-inline-block align-middle">
															<div class="iti-flag {if $activeLocale.countryCode === '001'}us{else}{$activeLocale.countryCode|lower}{/if}"></div>
														</div>
														{$activeLocale.localisedName}{/if}{if $languagechangeenabled && count($locales) > 1 && $currencies && !$loggedin}&nbsp;|&nbsp;{/if}{if !$loggedin && $currencies}{$activeCurrency.prefix} {$activeCurrency.code}{/if}
													</button>
												</div>
											{/if}
										{/if}
									{/if}
								</div>
                                  
                                {assign var=freedomaindisplay value='none' }
                                {if $freedomainpaymentterms|strstr:$BACKCART['products'][0]['billingcycle']}                                 
                                    {assign var=freedomaindisplay value='block' }
                                {/if}
                                
                                {if ($CONFIG.AllowRegister == 'on' || $CONFIG.AllowTransfer == 'on') && $freedomainvar}
                                    <div class="domain_spcl_offer" style="display:{$freedomaindisplay};">
                                        <p>
                                            <span class="bold">Get a free <span class="terms-once">1 year</span> {$LANG.orderdomainregonly}</span>{if $CONFIG.AllowTransfer == 'on'} or <span class="bold">{$LANG.orderdomaintransfer}</span>{/if}
                                        </p>  
                                                                            
                                        {if $freedomaintlds}
											<p><small>{$LANG.orderfreedomainappliesto}: <span id="freetlds">{$freedomaintlds}</span></small></p>
                                        {/if}
                                    </div>
                                {/if}

								<div class="blocks_body domains">
									<div class="domain-section-tabs{if $domainorder != 'all'} hidden{/if}">
										{if $CONFIG.AllowRegister == 'on'}
											<a href="javascript:void(0)" {if $domainorder != 'all' && $domainorder == 'transfer'}style="display: none"{/if} class="domain_sec domain-register {if !isset($BACKCART['domains'][0]['type']) && (!isset($BACKCART['products'][0]['domain']) || $BACKCART['products'][0]['domain'] == '')}domain_sec_active{/if} {if $BACKCART['domains'][0]['type'] == 'register'}domain_sec_active{/if}">
												<input type="radio" class="no-radio no-icheck" name="domaintype" value="register" id="register" {if  !isset($BACKCART['domains'][0]['type']) && (!isset($BACKCART['products'][0]['domain']) || $BACKCART['products'][0]['domain'] == '') && $domainorder !== 'transfer' }checked="checked"{/if} {if $BACKCART['domains'][0]['type'] == 'register'}checked="checked"{/if} />&nbsp;{$LANG.navdomainsearch}
											</a> 
										{/if}
										{if $CONFIG.AllowTransfer == 'on'}
											<a href="javascript:void(0)" {if $domainorder != 'all' && $domainorder == 'register'}style="display: none"{/if}  class="domain_sec domain-trans {if $BACKCART['domains'][0]['type'] == 'transfer'}domain_sec_active{/if}">
												<input type="radio" class="no-radio no-icheck" name="domaintype" {if $BACKCART['domains'][0]['type'] == 'transfer'}checked='checked'{/if} value="transfer" id="transfer"/>&nbsp;{$LANG.domaintransfer}
											</a>  
										{/if}
										{if $domainorder == 'all'}
											{if $CONFIG.AllowOwnDomain == 'on'}
												<a href="javascript:void(0)" class="domain_sec domain-own {if $BACKCART['products'][0]['domain'] != '' && !empty($BACKCART['domains']) <= 0}domain_sec_active{/if}">
													<input type="radio" class="no-radio no-icheck" name="domaintype" {if $owndomainmarket || ($BACKCART['products'][0]['domain'] != '' && !empty($BACKCART['domains']) <= 0)}checked='checked'{/if} value="owndomain" id="owndomain"/>&nbsp;<span style="display:inline" class="owndomaintext">{$LANG.domaincheckerhostingonly}</span><span class="marketconnecttext" style="display:none">{$LANG.store.domainAlreadyOwned}</span>
												</a> 
											{/if}
										{/if}
										<a href="javascript:void(0)" class="hidden domain_sec domain-subdomain">
											<input type="radio" class="no-radio no-icheck" name="domaintype" value="subdomain" id="subdomain"/>&nbsp;{$LANG.orderusesubdomain}
										</a> 
									</div>
									<div class="domain-input clearfix hidden" id="domainsubdomain">
										<div class="sd-desc">
											{$LANG.cartsubdomainchoice|sprintf2:$companyname}
										</div>
										<div class="row">
											<div class="col-sm-10">
												<div class="row domains-row">
													<div class="col-xs-7 col-7">
														<div class="input-group">
															<span class="input-group-prepend">
																<span class="input-group-text">https://</span>
															</span>																
															<input type="text" name="subdomainvaltext" id="subdomainsld" value="" placeholder="yourname" class="form-control" autocapitalize="none" onkeyup="$(this).val($(this).val().toLowerCase())" onblur="this.value=removeSpaces(this.value);" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.enterDomain'}" />
														</div>
													</div>														
													<div class="col-xs-5 col-5">
														<select id="subdomaintld" name="subdomainval" class="form-control">
														</select>
													</div>
												</div>
											</div>
											<div class="col-sm-2">
												<button type="button" onclick="checksubdomain()" class="btn btn-primary btn-block">
													{$LANG.orderForm.check}
												</button>
											</div>
										</div>
										<div class="domainloaderi loader-img" style="display: none;margin: 25px;"><i class="fad fa-circle-notch fa-spin fa-2x"></i></div>
										<div class="domain-msg1" id="domain_msg1" style="display: none;"></div>
									</div>
									<div class="domain-input">
										<div class="dr-desc {if $domainorder != 'all' && $domainorder == 'transfer'}hidden{/if}">
											{$LANG.cartregisterdomainchoice|sprintf2:$companyname}
										</div>
										<div class="dt-desc {if $domainorder != 'all' && $domainorder == 'transfer'}{else}hidden{/if}">
											{$LANG.carttransferdomainchoice|sprintf2:$companyname}
										</div>
										<div class="do-desc hidden">
											{$LANG.cartexistingdomainchoice|sprintf2:$companyname}
										</div>
										
										<div class="domain-inputs-sec">
											<div class="domain-input-col">
												<div class="input-group">
													<span class="input-group-prepend">
														<span class="input-group-text">www.</span>
													</span>	
													 <input type="text" value="{if $owndomainmarket}{$owndomainmarket}{else}{if !empty($BACKCART['domains'][0]['domain_cart']) && $BACKCART['domains'][0]['type'] != 'owndomain'}{$BACKCART['domains'][0]['domain_cart'][0]}{elseif !empty($BACKCART['domains'][0]['domain_cart']) <= 0 && $BACKCART['products'][0]['domain'] != ''}{$BACKCART['products'][0]['domain']}{/if}{/if}" name="domain" id="domainname" class="form-control" data-toggle="tooltip" data-placement="top" onblur="this.value=removeSpaces(this.value);" onkeyup="$(this).val($(this).val().toLowerCase())" data-trigger="manual" title="{lang key='orderForm.enterDomain'}" />
													 <input type="hidden" value="" name="hiddendomain" id="hiddendomainname"/>
												 </div>
											 </div>
											 <div class="tld">
												<select class="form-control select2-single" id="tldepp" name="tld">
												   {foreach from=$tlds key=num item=tld}
													   <option value="{$tld.extension}" data-epp="{$tld.eppcode}" {if !empty($BACKCART['domains'][0]['domain_cart']) && $BACKCART['domains'][0]['domain_cart'][1] == $tld.extension}selected='selected'{/if}>{$tld.extension}</option>
												   {/foreach}
												</select>
											 </div>
											 <div class="authcode" style="display: none;"> 
												 <input type="text" name="eppcode" value="" id="eppcode" class="form-control" placeholder="{lang key='orderForm.authCodePlaceholder'}" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{lang key='orderForm.authCodeTooltip'}" />
											 </div>
											 <div class="domain_search">
												 <button class="btn btn-primary btn-block" onclick="domainSearch();">{$LANG.search}</button>
											 </div>
										</div>
										<div class="domainloaderi loader-img" style="display: none;margin: 25px;"><i class="fad fa-circle-notch fa-spin fa-2x"></i></div>
										<div class="domain-msg" id="domain_msg" style="display: none;">
											{foreach from=$existingdomains item=edomain}
											{if !$edomain.domain} {continue} {/if}
													<div data-domain="{$edomain.domain}" class="alert domainresuc domain_success"><strong>{$edomain.domain}</strong>, {$LANG.orderForm.domainAddedToCart}<a href="#" class="close btn-add-to-cart2 btn-domain-remove" data-domain="{$edomain.domain}" aria-label="close"><i class="fas fa-times"></i></a></div>
											{/foreach}
										</div>
										<div class="suggested-domains{if !$showSuggestionsContainer} hidden{/if}">
											<div class="panel-heading">
												{lang key='orderForm.suggestedDomains'}
											</div>
											<div id="suggestionsLoader" class="panel-body domain-lookup-loader domain-lookup-suggestions-loader">
												<i class="fas fa-spinner fa-spin"></i> {lang key='orderForm.generatingSuggestions'}
											</div>
											<ul id="domainSuggestionsbackup" style="display: none"><li class="domain-suggestion list-group-item hidden">
													<span class="domain"></span><span class="extension"></span>
													<span class="promo hidden">
														<span class="sales-group-hot hidden">{lang key='domainCheckerSalesGroup.hot'}</span>
														<span class="sales-group-new hidden">{lang key='domainCheckerSalesGroup.new'}</span>
														<span class="sales-group-sale hidden">{lang key='domainCheckerSalesGroup.sale'}</span>
													</span>
													<div class="actions">
														<span class="price"></span>
														<button type="button" class="btn btn-add-to-cart2" data-whois="1" data-domain="">
															<span class="to-add">{$LANG.addtocart}</span>
															<span class="added"><i class="far fa-shopping-cart"></i>{$LANG.domaincheckeradded} - <span class="removedd">{$LANG.cartremove}?</span></span>
															<span class="unavailable">{$LANG.domaincheckertaken}</span>
														</button>
														<button type="button" class="btn btn-primary domain-contact-support hidden">
															{lang key='domainChecker.contactSupport'}
														</button>
													</div>
												</li>
											</ul>
											<ul id="domainSuggestions" class="domain-lookup-result list-group hidden">
												<li class="domain-suggestion list-group-item hidden">
													<span class="domain"></span><span class="extension"></span>
													<span class="promo hidden">
														<span class="sales-group-hot hidden">{lang key='domainCheckerSalesGroup.hot'}</span>
														<span class="sales-group-new hidden">{lang key='domainCheckerSalesGroup.new'}</span>
														<span class="sales-group-sale hidden">{lang key='domainCheckerSalesGroup.sale'}</span>
													</span>
													<div class="actions">
														<span class="price"></span>
														<button type="button" class="btn btn-add-to-cart2" data-whois="1" data-domain="">
															<span class="to-add">{$LANG.addtocart}</span>
															<span class="added"><i class="far fa-shopping-cart"></i>{$LANG.domaincheckeradded} - <span class="removedd">{$LANG.cartremove}?</span></span>
															<span class="unavailable">{$LANG.domaincheckertaken}</span>
														</button>
														<button type="button" class="btn btn-primary domain-contact-support hidden">
															{lang key='domainChecker.contactSupport'}
														</button>
													</div>
												</li>
											</ul>
											<div class="panel-footer more-suggestions hidden text-center">
												<a id="moreSuggestions" href="#" onclick="loadMoreSuggestions();
														return false;">{lang key='domainsmoresuggestions'}</a>
												<span id="noMoreSuggestions" class="no-more small hidden">{lang key='domaincheckernomoresuggestions'}</span>
											</div>
											<div class="text-center text-muted domain-suggestions-warning">
												<p>{lang key='domainssuggestionswarnings'}</p>
											</div>
										</div>
									</div>
								</div>

                            </div>
                            <div class="domain_config" style="display: none;">
                                <div class="TM-card blocks domainconfig">
                                    <div class="blocks_heading">
                                        <h2>{$LANG.cartdomainsconfig}</h2>
                                    </div>
                                    <div class="blocks_body" id="domain_config"></div>
                                </div>
                            </div> 
                        {/if}
                        <div class="product_config" style="display: none;">
                            <div class="p_config_error" style="display: none;"></div>
                            <div class="blocks_body" id="product_config"></div>
						</div>
						
                    </form>
                    <div id="ws-ajax-order-form">
                    </div>
                </div>
                <div class="col-lg-4 col-xl-3">
					{include file="$template/core/includes/sidebarspc.tpl"}
                </div>
            </div>
        </div>
    </div>
</div>

{elseif $ordertype == 'domainrenewals'}
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/domainrenewal.min.js?v={$versionHash}"></script>
<script>
	jQuery(document).ready(function () {
		recalcsummary();
		recalcheckout();
		{if $pid}jQuery('#pid_{$pid}').trigger('click');{/if}	
    });
	var ccdordertype = 'domainrenewals';
</script>

{if $themesettings.orderform.opcnoheader}
<div class="hero spc">
    <div class="container">
		<div class="logo-section">
			<a class="logo" href="{if $themesettings.headersetting.CustomLogoLink}{$themesettings.headersetting.CustomLogoLink}{else}{$WEB_ROOT}/{/if}">
				{if $themesettings.general.enablelogo}
					<img src="{$themesettings.general.logourl}" alt="{$companyname}" class="logo-light" />
					{if $themesettings.general.darklogo}
						<img src="{$themesettings.general.darklogo}" alt="{$companyname}" class="logo-dark" />
					{else}
					<span class="logo-dark">{$companyname}</span>
					{/if}
				{else}
					<span class="logo-light">{$companyname}</span>
				{/if}
			</a>
		</div>
    </div>
</div>
{else}
{if $themesettings.general.bannerstyle}
<div{if $themesettings.general.bsbgstyle eq "1"} class="small-header header-banner-styled bg-primary position-relative mb-5"{else} class="hero-bg-wrap small-header header-banner-styled inverse bg-opacity mb-5"{if $themesettings.general.bheaderbg} style="background-image:url('{$themesettings.general.bheaderbg}');"{/if}{/if}>
	{if $themesettings.general.bsbgstyle eq "1"}
		<div class="cros-bg-shapes-right"></div>
		<div class="cros-bg-shapes-left"></div>
	{/if}        
	<div class="container">
        <div class="page-title position-relative">
            <div class="header-lined">
				<div>
					<h1>
						{if $totalResults > 1}{lang key='navrenewdomains'}{else}{lang key='domainrenewal'}{/if}
					</h1>
					{if count($renewals) > 3}
						<div class="search-group">
							<input id="domainRenewalFilter" type="search" class="form-control" placeholder="{lang key='searchenterdomain'}">
						</div>
					{/if}
				</div>
				<div>
					{include file="$template/includes/breadcrumb.tpl"}
				</div>
			</div>
		</div>
    </div>
</div>
{else}
<div class="hero d-flex align-items-center no-padding-bottom">
    <div class="container">
        <div class="page-title">
            <div class="header-lined">
				<div>
					<h1 class="fw-900">
						{if count($renewals) > 1}{lang key='domainrenewals'}{else}{lang key='domainrenewal'}{/if}
					</h1>
					{if count($renewals) > 3}
						<div class="search-group">
							<input id="domainRenewalFilter" type="search" class="form-control" placeholder="{lang key='searchenterdomain'}">
						</div>
					{/if}
				</div>
			</div>
		</div>
	</div>
</div>
{/if}
{/if}

{if count($renewals) == 0}
    <div class="container">
        <div id="no-domains" class="alert alert-warning text-center" role="alert">
            {lang key='domainRenewal.noDomains'}
        </div>
        <p class="text-center">
            <a href="clientarea.php" class="btn btn-default">
                <i class="fas fa-arrow-circle-left"></i>
                {$LANG.orderForm.returnToClientArea}
            </a>
        </p>
    </div>
{else}
    <div id="order-standard_cart">
        <input type="hidden" value="{$promocode}" id="hiddenpromo"/>
        <div class="cat-loader" style="display: none;">
            <div class="loader-icon">
                <i class="fad fa-circle-notch fa-spin fa-3x"></i>
            </div>	
        </div>
        <div class="container">
            <div class="onepage_cart" id="onepage_cart">
                <div class="row ajaxcart_cont">
                    <div class="col-lg-8 col-xl-9">
						<span class="d-block d-lg-none float-right">
							<a href="{$WEB_ROOT}/order.php?ordertype=domain_renewal" onclick="emptyCart()" class="btn btn-link btn-emptycart" data-toggle="tooltip" data-placement="top" title="{$LANG.emptycart}"><i class="fas fa-trash"></i> {$LANG.emptycart}</a>
						</span>
						<div class="clearfix"></div>
						
                        <div class="domain_error" style="display: none;"></div>
						
						{if $themesettings.orderform.opcnoheader}
							{if count($renewals) > 5}
								<div class="search-group mb-3">
									<input id="domainRenewalFilter" type="search" class="form-control" placeholder="{lang key='searchenterdomain'}">
								</div>
							{/if}
						{/if}
					
                        <form method="post" id="coniguration_form" action="cart.php?a=add&renewals=true">
							<div id="domainRenewals" class="domain-renewals">
								{foreach from=$renewals item=renewal}
								{if $smarty.get.domain eq $renewal.domain}
								<div class="card renewals" data-domain="{$renewal.domain}">
									<div class="card-body p-3">
										<div class="d-flex flex-column flex-sm-row justify-content-between">
											<h4 class="m-0">{$renewal.domain}</h4>
											<div>												
												{if !$renewal.eligibleForRenewal}
													<span class="label label-info">
														{if $renewal.freeDomainRenewal}
															{lang key='domainRenewal.freeWithService'}
														{else}
															{lang key='domainRenewal.unavailable'}
														{/if}
													</span>
												{elseif ($renewal.pastGracePeriod && $renewal.pastRedemptionGracePeriod)}
													<span class="label label-info">
														{lang key='domainrenewalspastgraceperiod'}
													</span>
												{elseif !$renewal.beforeRenewLimit && $renewal.daysUntilExpiry > 0}
													<span class="label label-{if $renewal.daysUntilExpiry > 30}success{else}warning{/if}">
														{lang key='domainRenewal.expiringIn' days=$renewal.daysUntilExpiry}
													</span>
												{elseif $renewal.daysUntilExpiry === 0}
													<span class="label label-grey">
														{lang key='expiresToday'}
													</span>
												{elseif $renewal.beforeRenewLimit}
													<span class="label label-info">
														{lang key='domainRenewal.maximumAdvanceRenewal' days=$renewal.beforeRenewLimitDays}
													</span>
												{else}
													<span class="label label-danger">
														{lang key='domainRenewal.expiredDaysAgo' days=$renewal.daysUntilExpiry*-1}
													</span>
												{/if}
											</div>
										</div>
										
										
										<p class="small text-muted">{lang key='clientareadomainexpirydate'}: {$renewal.expiryDate->format('j M Y')} ({$renewal.expiryDate->diffForHumans()})</p>
										{if $renewal.freeDomainRenewal}
											<p class="small text-muted domain-renewal-desc">{lang key='domainRenewal.freeWithServiceDesc'}</p>
										{/if}
										
										<div class="domain-renewal-form">
										{if ($renewal.pastGracePeriod && $renewal.pastRedemptionGracePeriod) || !count($renewal.renewalOptions)}
										{else}
											<div class="domain-renewal-period">
												<select class="form-control input-lg select-renewal-pricing" name="renewalperiod[{$renewal.id}]" id="renewalPricing{$renewal.id}" data-domain-id="{$renewal.id}">
													{foreach $renewal.renewalOptions as $renewalOption}
														<option value="{$renewalOption.period}">
															{$renewalOption.period} {lang key='orderyears'} @ {$renewalOption.rawRenewalPrice}
															{if $renewalOption.gracePeriodFee && $renewalOption.gracePeriodFee->toNumeric() != 0.00}
																+ {$renewalOption.gracePeriodFee} {lang key='domainRenewal.graceFee'}
															{/if}
															{if $renewalOption.redemptionGracePeriodFee && $renewalOption.redemptionGracePeriodFee->toNumeric() != 0.00}
																+ {$renewalOption.redemptionGracePeriodFee} {lang key='domainRenewal.redemptionFee'}
															{/if}
														</option>
													{/foreach}
												</select>
											</div>
										{/if}
										{if !$renewal.eligibleForRenewal || $renewal.beforeRenewLimit || ($renewal.pastGracePeriod && $renewal.pastRedemptionGracePeriod)}
										{else}
											<div class="domain-renewal-action">
												<label class="m-0">
													<input type="checkbox" class="no-icheck nocheck domainrenewald" name="renewalids[]" value="{$renewal.id}" />
													<span class="scheck btn btn-primary btn-sm pl-3 pr-2 py-0"><h6 class="h5 small">{lang key='addtocart'}</h6></span>
												</label>
											</div>
										{/if}
										</div>
										
									</div>
								</div>
								{elseif !$smarty.get.domain}
								<div class="card renewals" data-domain="{$renewal.domain}">
									<div class="card-body p-3">
										<div class="d-flex flex-column flex-sm-row justify-content-between">
											<h4 class="m-0">{$renewal.domain}</h4>
											<div>												
												{if !$renewal.eligibleForRenewal}
													<span class="label label-info">
														{if $renewal.freeDomainRenewal}
															{lang key='domainRenewal.freeWithService'}
														{else}
															{lang key='domainRenewal.unavailable'}
														{/if}
													</span>
												{elseif ($renewal.pastGracePeriod && $renewal.pastRedemptionGracePeriod)}
													<span class="label label-info">
														{lang key='domainrenewalspastgraceperiod'}
													</span>
												{elseif !$renewal.beforeRenewLimit && $renewal.daysUntilExpiry > 0}
													<span class="label label-{if $renewal.daysUntilExpiry > 30}success{else}warning{/if}">
														{lang key='domainRenewal.expiringIn' days=$renewal.daysUntilExpiry}
													</span>
												{elseif $renewal.daysUntilExpiry === 0}
													<span class="label label-grey">
														{lang key='expiresToday'}
													</span>
												{elseif $renewal.beforeRenewLimit}
													<span class="label label-info">
														{lang key='domainRenewal.maximumAdvanceRenewal' days=$renewal.beforeRenewLimitDays}
													</span>
												{else}
													<span class="label label-danger">
														{lang key='domainRenewal.expiredDaysAgo' days=$renewal.daysUntilExpiry*-1}
													</span>
												{/if}
											</div>
										</div>
										
										
										<p class="small text-muted">{lang key='clientareadomainexpirydate'}: {$renewal.expiryDate->format('j M Y')} ({$renewal.expiryDate->diffForHumans()})</p>
										{if $renewal.freeDomainRenewal}
											<p class="small text-muted domain-renewal-desc">{lang key='domainRenewal.freeWithServiceDesc'}</p>
										{/if}
										
										<div class="domain-renewal-form">
										{if ($renewal.pastGracePeriod && $renewal.pastRedemptionGracePeriod) || !count($renewal.renewalOptions)}
										{else}
											<div class="domain-renewal-period">
												<select class="form-control input-lg select-renewal-pricing" name="renewalperiod[{$renewal.id}]" id="renewalPricing{$renewal.id}" data-domain-id="{$renewal.id}">
													{foreach $renewal.renewalOptions as $renewalOption}
														<option value="{$renewalOption.period}">
															{$renewalOption.period} {lang key='orderyears'} @ {$renewalOption.rawRenewalPrice}
															{if $renewalOption.gracePeriodFee && $renewalOption.gracePeriodFee->toNumeric() != 0.00}
																+ {$renewalOption.gracePeriodFee} {lang key='domainRenewal.graceFee'}
															{/if}
															{if $renewalOption.redemptionGracePeriodFee && $renewalOption.redemptionGracePeriodFee->toNumeric() != 0.00}
																+ {$renewalOption.redemptionGracePeriodFee} {lang key='domainRenewal.redemptionFee'}
															{/if}
														</option>
													{/foreach}
												</select>
											</div>
										{/if}
										{if !$renewal.eligibleForRenewal || $renewal.beforeRenewLimit || ($renewal.pastGracePeriod && $renewal.pastRedemptionGracePeriod)}
										{else}
											<div class="domain-renewal-action">
												<label class="m-0">
													<input type="checkbox" class="no-icheck nocheck domainrenewald" name="renewalids[]" value="{$renewal.id}" />
													<span class="scheck btn btn-primary btn-sm pl-3 pr-2 py-0"><h6 class="h5 small">{lang key='addtocart'}</h6></span>
												</label>
											</div>
										{/if}
										</div>
										
									</div>
								</div>
								{/if}
								<div class="text-center">
									<small>
										{if $hasDomainsInGracePeriod}
											* {lang key='domainRenewal.graceRenewalPeriodDescription'}
										{/if}
									</small>
								</div>
								{foreachelse}
									<div class="alert alert-info">
										{$LANG.domainrenewalsnoneavailable}
									</div>
								{/foreach}
							</div>
                        </form>
                        <div id="ws-ajax-order-form">
                        </div>
                    </div>
                    <div class="col-lg-4 col-xl-3">
						{include file="$template/core/includes/sidebarspc.tpl"}
                    </div>
                </div>
            </div>
        </div>
    </div>
{/if}

<script>
jQuery(document).ready(function() {
	jQuery(function() {    
        jQuery('#domainRenewalFilter').on('keyup', function() {
          var rex = new RegExp($(this).val(), 'i');
            $('.renewals').hide();
            $('.renewals').filter(function() {
                return rex.test($(this).text());
            }).show();
        });
    });
});	
</script>

{elseif $ordertype == 'servicerenewals'}
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/servicerenewal.js?v={$versionHash}"></script>
<script>
	jQuery(document).ready(function () {
		recalcsummary();
		recalcheckout();
		{if $pid}jQuery('#pid_{$pid}').trigger('click');{/if}	
    });
	var ccdordertype = 'servicerenewals';
</script>

{if $themesettings.orderform.opcnoheader}
<div class="hero spc">
    <div class="container">
		<div class="logo-section">
			<a class="logo" href="{if $themesettings.headersetting.CustomLogoLink}{$themesettings.headersetting.CustomLogoLink}{else}{$WEB_ROOT}/{/if}">
				{if $themesettings.general.enablelogo}
					<img src="{$themesettings.general.logourl}" alt="{$companyname}" class="logo-light" />
					{if $themesettings.general.darklogo}
						<img src="{$themesettings.general.darklogo}" alt="{$companyname}" class="logo-dark" />
					{else}
					<span class="logo-dark">{$companyname}</span>
					{/if}
				{else}
					<span class="logo-light">{$companyname}</span>
				{/if}
			</a>
		</div>
    </div>
</div>
{else}
{if $themesettings.general.bannerstyle}
<div{if $themesettings.general.bsbgstyle eq "1"} class="small-header header-banner-styled bg-primary position-relative mb-5"{else} class="hero-bg-wrap small-header header-banner-styled inverse bg-opacity mb-5"{if $themesettings.general.bheaderbg} style="background-image:url('{$themesettings.general.bheaderbg}');"{/if}{/if}>
	{if $themesettings.general.bsbgstyle eq "1"}
		<div class="cros-bg-shapes-right"></div>
		<div class="cros-bg-shapes-left"></div>
	{/if}        
	<div class="container">
        <div class="page-title position-relative">
            <div class="header-lined">
				<div>
					<h1>
						{if $totalResults > 1}{lang key='renewService.titlePlural'}{else}{lang key='renewService.titleSingular'}{/if}
					</h1>
					{if $totalResults > 3}
						<div class="search-group">
							<input id="serviceRenewalFilter" type="search" class="form-control" placeholder="{lang key='renewService.searchPlaceholder'}">
						</div>
					{/if}
				</div>
				<div>
					{include file="$template/includes/breadcrumb.tpl"}
				</div>
			</div>
		</div>
    </div>
</div>
{else}
<div class="hero d-flex align-items-center no-padding-bottom">
    <div class="container">
        <div class="page-title">
            <div class="header-lined">
				<div>
					<h1 class="fw-900">
						{if $totalResults > 1}{lang key='renewService.titlePlural'}{else}{lang key='renewService.titleSingular'}{/if}
					</h1>
					{if $totalResults > 3}
						<div class="search-group">
							<input id="serviceRenewalFilter" type="search" class="form-control" placeholder="{lang key='renewService.searchPlaceholder'}">
						</div>
					{/if}
				</div>
			</div>
		</div>
	</div>
</div>
{/if}
{/if}

{if $totalServiceCount == 0}
    <div class="container">
        <div id="no-domains" class="alert alert-warning text-center" role="alert">
            {lang key='renewService.noServices'}
        </div>
        <p class="text-center">
            <a href="clientarea.php" class="btn btn-default">
                <i class="fas fa-arrow-circle-left"></i>
                {$LANG.orderForm.returnToClientArea}
            </a>
        </p>
    </div>
{else}
    <div id="order-standard_cart">
        <input type="hidden" value="{$promocode}" id="hiddenpromo"/>
        <div class="cat-loader" style="display: none;">
            <div class="loader-icon">
                <i class="fad fa-circle-notch fa-spin fa-3x"></i>
            </div>	
        </div>
        <div class="container">
            <div class="onepage_cart" id="onepage_cart">
                <div class="row ajaxcart_cont">
                    <div class="col-lg-8 col-xl-9">
						<span class="d-block d-lg-none float-right">
							<a href="{$WEB_ROOT}/order.php?ordertype=service_renewal" onclick="emptyCart()" class="btn btn-link btn-emptycart" data-toggle="tooltip" data-placement="top" title="{$LANG.emptycart}"><i class="fas fa-trash"></i> {$LANG.emptycart}</a>
						</span>
						<div class="clearfix"></div>
						
                        <div class="service_error" style="display: none;"></div>
						
						{if $themesettings.orderform.opcnoheader}
							{if $totalResults > 5}
								<div class="search-group mb-3">
									<input id="serviceRenewalFilter" type="search" class="form-control" placeholder="{lang key='renewService.searchPlaceholder'}">
								</div>
							{/if}
						{/if}
					
                        <form method="post" id="coniguration_form" action="cart.php?a=add&renewals=true">
							<div id="serviceRenewals" class="domain-renewals">
								{foreach from=$renewableServices item=renewableService}
								<div class="card renewals" data-product-name="{$renewableService.product.name}" data-service-id="{$renewableService.serviceId}" data-service-domain="{$renewableService.domain}">
									<div class="card-body p-3">
										<div class="d-flex flex-column flex-sm-row justify-content-between">
											<h4 class="m-0">{$renewableService.product.name}</h4>
											<div>
												<span class="label label-warning">
													{lang key='renewService.renewingIn' days=$renewableService.nextDueDate->diffInDays()}
												</span>
											</div>
										</div>

										<p class="small text-muted">{$renewableService.domain}</p>
										
										<p>
											{if is_null($renewableService.nextDueDate)}
												{lang key='renewService.serviceNextDueDateBasic' nextDueDate={lang key='na'}}
											{else}
												{lang key='renewService.serviceNextDueDateExtended' nextDueDate=$renewableService.nextDueDate->toClientDateFormat() nextDueDateFormatted=$renewableService.nextDueDate->diffForHumans()}
											{/if}
										</p>
									</div>
									<div class="card-footer">
										<div class="domain-renewal-form d-flex space-between flex-column flex-md-row align-items-md-center">
											<div class="domain-renewal-period">
												<div class="div-renewal-period-label">
													{lang key='renewService.renewalPeriodLabel'}
												</div>
												<div>
													{lang key='renewService.renewalPeriod' nextDueDate=$renewableService.nextDueDate->toClientDateFormat() nextPayUntilDate=$renewableService.nextPayUntilDate->toClientDateFormat() renewalPrice=$renewableService.price}
												</div>
											</div>
											<div class="domain-renewal-action mt-md-0 mt-3">
												<label class="m-0">
													<input type="checkbox" class="no-icheck nocheck servicerenewald" name="renewalids[]" value="{$renewableService.serviceId}" />
													<span class="scheck btn btn-primary btn-sm pl-3 pr-2 py-0"><h6 class="h5 small">{lang key='addtocart'}</h6></span>
												</label>
											</div>
										</div>
									</div>
									{if !empty($renewableService.addons)}
										<div class="addon-renewals m-3" {if $renewableService.renewableCount <= 0}style="display: none;" data-is-renewable="false" {else}data-is-renewable="true"{/if}>
											<h4><strong>{lang key='cartaddons'}</strong></h4>
											<div>
												{foreach from=$renewableService.addons item=$renewableAddon}
												<div class="card renewals" data-product-name="{$renewableAddon.product.name}" data-service-id="{$renewableAddon.serviceId}" data-service-domain="{$renewableAddon.domain}">
													<div class="card-body p-3">
														<div class="d-flex flex-column flex-sm-row justify-content-between">
															<h4 class="m-0">{$renewableAddon.product.name}</h4>
															<div>
																<span class="label label-warning">
																	{lang key='renewService.renewingIn' days=$renewableAddon.nextDueDate->diffInDays()}
																</span>
															</div>
														</div>
				
														<p class="small text-muted">{$renewableAddon.domain}</p>
														
														<p>
															{if is_null($renewableAddon.nextDueDate)}
																{lang key='renewService.serviceNextDueDateBasic' nextDueDate={lang key='na'}}
															{else}
																{lang key='renewService.serviceNextDueDateExtended' nextDueDate=$renewableAddon.nextDueDate->toClientDateFormat() nextDueDateFormatted=$renewableAddon.nextDueDate->diffForHumans()}
															{/if}
														</p>
													</div>
													<div class="card-footer">
														<div class="domain-renewal-form d-flex space-between flex-column flex-md-row align-items-md-center">
															<div class="domain-renewal-period">
																<div class="div-renewal-period-label">
																	{lang key='renewService.renewalPeriodLabel'}
																</div>
																<div>
																	{lang key='renewService.renewalPeriod' nextDueDate=$renewableAddon.nextDueDate->toClientDateFormat() nextPayUntilDate=$renewableAddon.nextPayUntilDate->toClientDateFormat() renewalPrice=$renewableAddon.price}
																</div>
															</div>
															<div class="domain-renewal-action mt-md-0 mt-3">
																<label class="m-0">
																	<input type="checkbox" class="no-icheck nocheck addonrenewald" name="renewalaids[]" value="{$renewableAddon.serviceId}" />
																	<span class="scheck btn btn-primary btn-sm pl-3 pr-2 py-0"><h6 class="h5 small">{lang key='addtocart'}</h6></span>
																</label>
															</div>
														</div>
													</div>
												</div>
												{/foreach}
											</div>
										</div>
									{/if}
								</div>
								{/foreach}
								{foreach $nonRenewableServices as $nonRenewableService}
								<div class="card renewals no-shadow" data-product-name="{$nonRenewableService.product.name}" data-service-id="{$nonRenewableService.serviceId}" data-service-domain="{$nonRenewableService.domain}">
									<div class="card-body p-3">
										<div class="d-flex flex-column flex-sm-row justify-content-between">
											<h4 class="m-0">{$nonRenewableService.product.name}</h4>
											<div>					
												<span class="label label-info">
													{lang key='renewService.renewalUnavailable'}
												</span>							
											</div>
										</div>

										<p class="small text-muted">{$nonRenewableService.domain}</p>
										
										<p>
											{if is_null($nonRenewableService.nextDueDate)}
												{lang key='renewService.serviceNextDueDateBasic' nextDueDate={lang key='na'}}
											{else}
												{lang key='renewService.serviceNextDueDateExtended' nextDueDate=$nonRenewableService.nextDueDate->toClientDateFormat() nextDueDateFormatted=$nonRenewableService.nextDueDate->diffForHumans()}
											{/if}
										</p>
									</div>
									<div class="card-footer">
										<div class="domain-renewal-form">
											<div class="domain-renewal-action">
												<label class="m-0">
													<i class="fas fa-info-circle fa-fw"></i>{$nonRenewableService.reason}
												</label>
											</div>
										</div>
									</div>
								</div>
								{/foreach}
							</div>
                        </form>
                        <div id="ws-ajax-order-form">
                        </div>
                    </div>
                    <div class="col-lg-4 col-xl-3">
						{include file="$template/core/includes/sidebarspc.tpl"}
                    </div>
                </div>
            </div>
        </div>
    </div>
{/if}

<script>
jQuery(document).ready(function() {
	jQuery(function() {    
        jQuery('#serviceRenewalFilter').on('keyup', function() {
          var rex = new RegExp($(this).val(), 'i');
            $('.renewals').hide();
            $('.renewals').filter(function() {
                return rex.test($(this).text());
            }).show();
        });
    });
});	
</script>

{elseif $ordertype == 'addons'}
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/addons.min.js?v={$versionHash}"></script>
<script>
	jQuery(document).ready(function () {
		recalcsummary();
		recalcheckout();
		{if $pid}jQuery('#pid_{$pid}').trigger('click');{/if}
    
	});
	var ccdordertype = 'addons';
</script>
{if $themesettings.orderform.opcnoheader}
<div class="hero spc">
    <div class="container">
		<div class="logo-section">
			<a class="logo" href="{if $themesettings.headersetting.CustomLogoLink}{$themesettings.headersetting.CustomLogoLink}{else}{$WEB_ROOT}/{/if}">
				{if $themesettings.general.enablelogo}
					<img src="{$themesettings.general.logourl}" alt="{$companyname}" class="logo-light" />
					{if $themesettings.general.darklogo}
						<img src="{$themesettings.general.darklogo}" alt="{$companyname}" class="logo-dark" />
					{else}
					<span class="logo-dark">{$companyname}</span>
					{/if}
				{else}
					<span class="logo-light">{$companyname}</span>
				{/if}
			</a>
		</div>
    </div>
</div>
{else}
{if $themesettings.general.bannerstyle}
<div{if $themesettings.general.bsbgstyle eq "1"} class="small-header header-banner-styled bg-primary position-relative mb-5"{else} class="hero-bg-wrap small-header header-banner-styled inverse bg-opacity mb-5"{if $themesettings.general.bheaderbg} style="background-image:url('{$themesettings.general.bheaderbg}');"{/if}{/if}>
	{if $themesettings.general.bsbgstyle eq "1"}
		<div class="cros-bg-shapes-right"></div>
		<div class="cros-bg-shapes-left"></div>
	{/if}        
	<div class="container">
        <div class="page-title position-relative">
            <div class="header-lined">
				<div>
					<h1>{$LANG.cartproductaddons}</h1>
				</div>
				<div>
					{include file="$template/includes/breadcrumb.tpl"}
				</div>
			</div>
		</div>
    </div>
</div>
{else}
<div class="hero d-flex align-items-center no-padding-bottom">
    <div class="container">
        <div class="page-title">
            <div class="header-lined">
				<div>
					<h1 class="fw-900">{$LANG.cartproductaddons}</h1>
				</div>
            </div>
        </div>
    </div>
</div>
{/if}
{/if}


{if count($addons) == 0}
    <div class="container">
        <div id="noAddons" class="alert alert-warning text-center" role="alert">
            {$LANG.cartproductaddonsnone}
        </div>
        <p class="text-center">
            <a href="clientarea.php" class="btn btn-default">
                <i class="fas fa-arrow-circle-left"></i>
                {$LANG.orderForm.returnToClientArea}
            </a>
        </p>
    </div>											
{else}
    <div id="order-standard_cart">
        <input type="hidden" value="{$promocode}" id="hiddenpromo"/>
        <div class="cat-loader" style="display: none;">
            <div class="loader-icon">
                <i class="fad fa-circle-notch fa-spin fa-3x"></i>
            </div>	
        </div>
        <div class="container">
            <div class="onepage_cart" id="onepage_cart">
                <div class="row ajaxcart_cont">
                    <div class="col-lg-8 col-xl-9">
						<span class="d-block d-lg-none float-right">
							<a href="{$WEB_ROOT}/order.php?ordertype=addons" onclick="emptyCart()" class="btn btn-link btn-emptycart" data-toggle="tooltip" data-placement="top" title="{$LANG.emptycart}"><i class="fas fa-trash"></i> {$LANG.emptycart}</a>
						</span>
						<div class="clearfix"></div>
						
                        <div class="products">
                            <div class="domain_error" style="display: none;"></div>
                            <form method="post" id="coniguration_form" action="cart.php?gid=addons=true">
                                <div class="row row-eq-height">                                    
                                    {foreach $addons as $num => $addon}
                                        <div class="col-md-6">
                                            <div class="product bg-white" id="product{$num}">
                                                <input type="hidden" name="aid" value="{$addon.id}" />
                                                <div class="product-addon-header">
                                                    <h4>{$addon.name}</h4>
                                                    {if $product.qty}
                                                        <span class="qty">
                                                            {$product.qty} {$LANG.orderavailable}
                                                        </span>
                                                    {/if}
                                                </div>
                                                <div class="product-body">
                                                    <p class="text-muted">{$addon.description}</p>
                                                </div>
                                                <div class="product-options">
                                                    <div class="form-group">
                                                        <select name="selpro[{$addon.id}]" id="inputProductId{$num}" class="form-control field">
                                                            {foreach $addon.productids as $product}
                                                                <option value="{$product.id}">
                                                                    {$product.product}{if $product.domain} - {$product.domain}{/if}
                                                                </option>
                                                            {/foreach}
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="product-addon-footer d-block">
                                                    <div class="product-pricing p-3 bg-light border rounded">
                                                        {if $addon.free}
                                                            {$LANG.orderfree}
                                                        {else}
                                                            <span class="price"><strong class="fw-500">{$addon.recurringamount}</strong> {$addon.billingcycle}</span>
                                                            {if $addon.havesetup}<br />+ {$addon.setupfee} {$LANG.ordersetupfee}{/if}
                                                        {/if}
                                                    </div>
                                                    <div class="product-actions w-100 mt-1">
                                                        <label class="m-0 w-100">
                                                            <input type="checkbox" class="no-icheck nocheck adaddons" name="adaddons[]" {if $smarty.get.aid==$addon.id} checked="checked" {/if} value="{$addon.id}" />
                                                            <span class="scheck btn btn-primary"><h6 class="h5">{$LANG.addtocart}</h6></span>
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {if $num % 2 != 0}
                                        </div>
                                        <div class="row row-eq-height">
                                        {/if}
                                    {/foreach}
                                </div>
                            </form>
                        </div>
                        <div id="ws-ajax-order-form">     
                        </div>
                    </div>
                    <div class="col-lg-4 col-xl-3">
						{include file="$template/core/includes/sidebarspc.tpl"}
                    </div>
                </div>
            </div>
        </div>
    </div>

{/if}
{/if}

<script type="text/javascript" src="{$BASE_PATH_JS}/jquery.payment.js"></script>
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/ResizeSensor.js"></script>
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/{$carttpl}/js/jquery.sticky-sidebar.min.js"></script>
<script>
    jQuery('#sidebar').stickySidebar({
        topSpacing: 90,
        bottomSpacing: 90,
        minWidth: 992,
        containerSelector: '.ajaxcart_cont',
        innerWrapperSelector: '.sidebar__inner'
    });
	jQuery(document).on('click', '.btn-cart-contents', function (e) {
		if (jQuery(window).width() <= 991) {
			jQuery('.cartsummary_cont .summary_body >.cart-contents').slideToggle();
		}
	});
	
	var hideCvcOnCheckoutForExistingCard = '{if $canUseCreditOnCheckout && $applyCredit && ($creditBalance->toNumeric() >= $total->toNumeric())}1{else}0{/if}';
    
	function loadMoreSuggestions()
    {
        return true;
    }
    $('#moreSuggestions').click(function() {
        var suggestions = jQuery('#domainSuggestions'),
        suggestionCount;
        var furtherSuggestions = suggestions.find('li.domain-suggestion.clone.hidden').length;
        

        for (suggestionCount = 1; suggestionCount <= 10; suggestionCount++) {
            if (furtherSuggestions > 0) {
                suggestions.find('li.domain-suggestion.hidden.clone:first').not().hide().removeClass('hidden').slideDown();
                furtherSuggestions = suggestions.find('li.domain-suggestion.clone.hidden').length;                  
                jQuery('div.more-suggestions').find('a').addClass('hidden').end().find('span.no-more').addClass('hidden');
                jQuery('#moreSuggestions').removeClass('hidden');
            } else {
                jQuery('div.more-suggestions').find('a').addClass('hidden').end().find('span.no-more').removeClass('hidden');
                return;
            }
        }
    });

	jQuery('.select2-single').select2();    
	
	{if $domainorder == 'all'}
		{if $smarty.get.pid} {else}
			jQuery(document).ready(function () {
				var slider = new Swiper(".plan-list-slider", {
					slidesPerView: 1,
					slideClass: "products-slide",
					pagination: {
						el: ".swiper-pagination",
						type: "fraction",
					},
					navigation: {
						nextEl: ".swiper-button-next",
						prevEl: ".swiper-button-prev",
					},
					breakpoints: {
						0: {
							slidesPerView: 1
						},
						768: {
						  slidesPerView: 2
						},
						992: {
						  slidesPerView: 2
						},
						1200: {
						  slidesPerView: 3
						},
					},
					on: {
						init: function () {
							this.allowTouchMove = this.slides.length > this.params.slidesPerView;
						},
						resize: function () {
							this.allowTouchMove = this.slides.length > this.params.slidesPerView;
						}
					}
				});
			});

		{/if}
	{/if}
	
	function removeSpaces(string) {
	 return string.split(' ').join('');
	}
	
	{if !$owndomainmarket}
   	function Epp()
    {
    	var tldepp = $("#tldepp option:selected").attr("data-epp");
   		if(tldepp=='0')
   		{
   			$('.authcode').css('display','none');
   			$(".authcode #eppcode").val(''); 
   			$('#eppcode').attr('id','none');
   		}
   		else
   		{
			{if $domainorder == 'transfer'}
				$('.authcode').css('display','block');
			{/if}
			$('.authcode').focus();
   			$('[name=\"eppcode\"]').attr('id','eppcode');
   		}
    }
    jQuery(document).ready(function() {
        Epp();
    });

   	jQuery("#tldepp").change(function() {
   		Epp();
	});
	
	{/if}
	
	jQuery(".promo_text").on("click", function() {
		jQuery('.promo_text').remove();
		jQuery('.promo_form').show();
	});
</script>
	
{if $stripejs}
    <script type="text/javascript" src="https://js.stripe.com/v3/"></script>   
{/if}