|
@@ -0,0 +1,538 @@
|
|
|
|
|
+{if $existingdomains}
|
|
|
|
|
+ <div class="option tab-pane" id="existing_domain">
|
|
|
|
|
+ <div class="domain-input-group clearfix" id="domainexisting_domain">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-sm-9">
|
|
|
|
|
+ <div class="row domains-row">
|
|
|
|
|
+ <div class="col-xs-2 text-right">
|
|
|
|
|
+ <p class="form-control-static">www.</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-xs-7">
|
|
|
|
|
+ <select id="existing_domainsld" name="existing_domaindomain" class="form-control">
|
|
|
|
|
+ {foreach key=num item=existingdomain from=$existingdomains}
|
|
|
|
|
+ <option value="{$existingdomain}">{$existingdomain}</option>
|
|
|
|
|
+ {/foreach}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-sm-2">
|
|
|
|
|
+ <button type="submit" id="b_existing_domain" class="btn btn-primary btn-block btn-lg">
|
|
|
|
|
+ {$LANG.orderForm.use}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {if $WSEXISTING.subdomain}
|
|
|
|
|
+ <div class="option tab-pane" id="subexisting">
|
|
|
|
|
+ <div class="domain-input-group clearfix" id="domainsubexisting" >
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-sm-9">
|
|
|
|
|
+ <div class="row domains-row">
|
|
|
|
|
+ <div class="col-xs-2 text-right">
|
|
|
|
|
+ <input name="subdomainexisting_domaindomain" autocapitalize="none" data-toggle="tooltip" data-placement="top" data-trigger="manual" title="{$EDLANG.UseaSubDomainTooltip}" id="subdomainexisting_domaindomains" class="form-control">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-xs-1 text-right" style="padding-right: 0px;padding-left: 0px;width: 2%;">
|
|
|
|
|
+ <p class="form-control-static">.</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-xs-6">
|
|
|
|
|
+ <input name="subexisting_domaindomain" type="hidden" value="" id="subexisting_domaindomainid">
|
|
|
|
|
+ <select id="subexisting_domainsld" name="subexisting_domaindomain" class="form-control">
|
|
|
|
|
+ {foreach key=num item=existingdomain from=$existingdomains}
|
|
|
|
|
+ <option data-oldv="{$existingdomain}" value="{$existingdomain}">{$existingdomain}</option>
|
|
|
|
|
+ {/foreach}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-sm-2">
|
|
|
|
|
+ <button type="submit" id="b_subexisting_domain" class="btn btn-submf btn-primary btn-block">
|
|
|
|
|
+ {$LANG.orderForm.use}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {/if}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {literal}
|
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
|
+ jQuery('#frmProductDomain').submit(function (e) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+
|
|
|
|
|
+ var btnSearchObj = jQuery(this).find('button[type="submit"]'),
|
|
|
|
|
+ domainSearchResults = jQuery("#DomainSearchResults"),
|
|
|
|
|
+ spotlightTlds = jQuery('#spotlightTlds'),
|
|
|
|
|
+ suggestions = jQuery('#domainSuggestions'),
|
|
|
|
|
+ btnDomainContinue = jQuery('#btnDomainContinue'),
|
|
|
|
|
+ domainoption = jQuery(".domain-tabs .active input").val(),
|
|
|
|
|
+ sldInput = jQuery("#" + domainoption + "sld"),
|
|
|
|
|
+ sld = sldInput.val(),
|
|
|
|
|
+ tld = '',
|
|
|
|
|
+ pid = jQuery('#frmProductDomainPid').val(),
|
|
|
|
|
+ tldInput = '';
|
|
|
|
|
+
|
|
|
|
|
+ if (domainoption == 'incart') {
|
|
|
|
|
+ sldInput = jQuery("#" + domainoption + "sld option:selected");
|
|
|
|
|
+ sld = sldInput.text();
|
|
|
|
|
+ } else if (domainoption == 'subdomain') {
|
|
|
|
|
+ tldInput = jQuery("#" + domainoption + "tld option:selected");
|
|
|
|
|
+ tld = tldInput.text();
|
|
|
|
|
+ } else if (domainoption == 'subexisting' || domainoption == 'subexisting_domain' || domainoption == 'existing_domain') {
|
|
|
|
|
+ if (domainoption == 'subexisting_domain') {
|
|
|
|
|
+ sld = jQuery("#subexisting_domaindomainid").val();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ sldInput = jQuery("#" + domainoption + "sld option:selected");
|
|
|
|
|
+ sld = sldInput.text();
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tldInput = jQuery("#" + domainoption + "tld");
|
|
|
|
|
+ tld = tldInput.val();
|
|
|
|
|
+ if (sld && !tld) {
|
|
|
|
|
+ tldInput.tooltip('show');
|
|
|
|
|
+ tldInput.focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (tld.substr(0, 1) != '.') {
|
|
|
|
|
+ tld = '.' + tld;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!sld) {
|
|
|
|
|
+ sldInput.tooltip('show');
|
|
|
|
|
+ sldInput.focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ sldInput.tooltip('hide');
|
|
|
|
|
+ if (tldInput.length) {
|
|
|
|
|
+ tldInput.tooltip('hide');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ jQuery('input[name="domainoption"]').iCheck('disable');
|
|
|
|
|
+ domainLookupCallCount = 0;
|
|
|
|
|
+ btnSearchObj.attr('disabled', 'disabled').addClass('disabled');
|
|
|
|
|
+
|
|
|
|
|
+ jQuery('.domain-lookup-result').addClass('hidden');
|
|
|
|
|
+ jQuery('#primaryLookupResult div').hide();
|
|
|
|
|
+ jQuery('#primaryLookupResult').find('.register-price-label').show().end()
|
|
|
|
|
+ .find('.transfer-price-label').addClass('hidden');
|
|
|
|
|
+
|
|
|
|
|
+ jQuery('.domain-lookup-register-loader').hide();
|
|
|
|
|
+ jQuery('.domain-lookup-transfer-loader').hide();
|
|
|
|
|
+ jQuery('.domain-lookup-other-loader').hide();
|
|
|
|
|
+ if (domainoption == 'register') {
|
|
|
|
|
+ jQuery('.domain-lookup-register-loader').show();
|
|
|
|
|
+ } else if (domainoption == 'transfer') {
|
|
|
|
|
+ jQuery('.domain-lookup-transfer-loader').show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ jQuery('.domain-lookup-other-loader').show();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ jQuery('.domain-lookup-loader').show();
|
|
|
|
|
+ suggestions.find('li').addClass('hidden').end()
|
|
|
|
|
+ .find('.clone').remove().end();
|
|
|
|
|
+ jQuery('div.panel-footer.more-suggestions').addClass('hidden')
|
|
|
|
|
+ .find('a').removeClass('hidden').end()
|
|
|
|
|
+ .find('span.no-more').addClass('hidden');
|
|
|
|
|
+ jQuery('.btn-add-to-cart').removeAttr('disabled')
|
|
|
|
|
+ .find('span').hide().end()
|
|
|
|
|
+ .find('span.to-add').show();
|
|
|
|
|
+ btnDomainContinue.addClass('hidden').attr('disabled', 'disabled');
|
|
|
|
|
+
|
|
|
|
|
+ if (domainoption != 'register') {
|
|
|
|
|
+ spotlightTlds.hide();
|
|
|
|
|
+ jQuery('.suggested-domains').hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!domainSearchResults.is(":visible")) {
|
|
|
|
|
+ domainSearchResults.hide().removeClass('hidden').fadeIn();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (domainoption == 'register') {
|
|
|
|
|
+ jQuery('.suggested-domains').hide().removeClass('hidden').fadeIn('fast');
|
|
|
|
|
+ spotlightTlds.hide().removeClass('hidden').fadeIn('fast');
|
|
|
|
|
+ jQuery('#resultDomainOption').val(domainoption);
|
|
|
|
|
+ var lookup = jQuery.post(
|
|
|
|
|
+ WHMCS.utils.getRouteUrl('/domain/check'),
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ type: 'domain',
|
|
|
|
|
+ domain: sld + tld
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ ),
|
|
|
|
|
+ spotlight = jQuery.post(
|
|
|
|
|
+ WHMCS.utils.getRouteUrl('/domain/check'),
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ type: 'spotlight',
|
|
|
|
|
+ domain: sld + tld
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ ),
|
|
|
|
|
+ suggestion = jQuery.post(
|
|
|
|
|
+ WHMCS.utils.getRouteUrl('/domain/check'),
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ type: 'suggestions',
|
|
|
|
|
+ domain: sld + tld
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // primary lookup handler
|
|
|
|
|
+ lookup.done(function (data) {
|
|
|
|
|
+ jQuery.each(data.result, function (index, domain) {
|
|
|
|
|
+ var pricing = null,
|
|
|
|
|
+ result = jQuery('#primaryLookupResult'),
|
|
|
|
|
+ available = result.find('.domain-available'),
|
|
|
|
|
+ availablePrice = result.find('.domain-price'),
|
|
|
|
|
+ unavailable = result.find('.domain-unavailable'),
|
|
|
|
|
+ invalid = result.find('.domain-invalid'),
|
|
|
|
|
+ contactSupport = result.find('.domain-contact-support'),
|
|
|
|
|
+ resultDomain = jQuery('#resultDomain'),
|
|
|
|
|
+ resultDomainPricing = jQuery('#resultDomainPricingTerm');
|
|
|
|
|
+ result.removeClass('hidden').show();
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ if (!data.result.error && domain.isValidDomain) {
|
|
|
|
|
+ pricing = domain.pricing;
|
|
|
|
|
+ if (domain.isAvailable && typeof pricing !== 'string') {
|
|
|
|
|
+ if (domain.preferredTLDNotAvailable) {
|
|
|
|
|
+ unavailable.show().find('strong').html(domain.originalUnavailableDomain);
|
|
|
|
|
+ }
|
|
|
|
|
+ contactSupport.hide();
|
|
|
|
|
+ available.show().find('strong').html(domain.domainName);
|
|
|
|
|
+ availablePrice.show().find('span.price').html(pricing[Object.keys(pricing)[0]].register).end()
|
|
|
|
|
+ .find('button').attr('data-domain', domain.idnDomainName);
|
|
|
|
|
+ resultDomain.val(domain.domainName);
|
|
|
|
|
+ resultDomainPricing.val(Object.keys(pricing)[0]).attr('name', 'domainsregperiod[' + domain.domainName + ']');
|
|
|
|
|
+
|
|
|
|
|
+ btnDomainContinue.removeAttr('disabled');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ unavailable.show().find('strong').html(domain.domainName);
|
|
|
|
|
+ contactSupport.hide();
|
|
|
|
|
+ if (typeof pricing === 'string' && pricing == 'ContactUs') {
|
|
|
|
|
+ contactSupport.show();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var invalidLength = invalid.find('span.domain-length-restrictions');
|
|
|
|
|
+ invalidLength.hide();
|
|
|
|
|
+ if (domain.minLength > 0 && domain.maxLength > 0) {
|
|
|
|
|
+ invalidLength.find('.min-length').html(domain.minLength).end()
|
|
|
|
|
+ .find('.max-length').html(domain.maxLength).end();
|
|
|
|
|
+ invalidLength.show();
|
|
|
|
|
+ }
|
|
|
|
|
+ invalid.show();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(3, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // spotlight lookup handler
|
|
|
|
|
+ spotlight.done(function (data) {
|
|
|
|
|
+ if (typeof data != 'object' || data.result.length == 0 || data.result.error) {
|
|
|
|
|
+ jQuery('.domain-lookup-spotlight-loader').hide();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ jQuery.each(data.result, function (index, domain) {
|
|
|
|
|
+ var tld = domain.tldNoDots,
|
|
|
|
|
+ pricing = domain.pricing,
|
|
|
|
|
+ result = jQuery('#spotlight' + tld + ' .domain-lookup-result');
|
|
|
|
|
+ jQuery('.domain-lookup-spotlight-loader').hide();
|
|
|
|
|
+ result.find('button').addClass('hidden').end();
|
|
|
|
|
+ if (domain.isValidDomain) {
|
|
|
|
|
+ if (domain.isAvailable && typeof pricing !== 'string') {
|
|
|
|
|
+ result
|
|
|
|
|
+ .find('span.available').html(pricing[Object.keys(pricing)[0]].register).removeClass('hidden').end()
|
|
|
|
|
+ .find('button.btn-add-to-cart')
|
|
|
|
|
+ .attr('data-domain', domain.idnDomainName)
|
|
|
|
|
+ .removeClass('hidden');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (typeof pricing === 'string') {
|
|
|
|
|
+ if (pricing == '') {
|
|
|
|
|
+ result.find('button.unavailable').removeClass('hidden').end();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ result.find('button.domain-contact-support').removeClass('hidden').end();
|
|
|
|
|
+ }
|
|
|
|
|
+ result.find('span.available').addClass('hidden').end();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ result.find('button.unavailable').removeClass('hidden').end();
|
|
|
|
|
+ result.find('span.available').addClass('hidden').end();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ result.find('button.invalid.hidden').removeClass('hidden').end()
|
|
|
|
|
+ .find('span.available').addClass('hidden').end()
|
|
|
|
|
+ .find('button').not('button.invalid').addClass('hidden');
|
|
|
|
|
+ }
|
|
|
|
|
+ result.removeClass('hidden');
|
|
|
|
|
+ });
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(3, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // suggestions lookup handler
|
|
|
|
|
+ suggestion.done(function (data) {
|
|
|
|
|
+ if (typeof data != 'object' || data.result.length == 0 || data.result.error) {
|
|
|
|
|
+ jQuery('.suggested-domains').fadeOut('fast', function () {
|
|
|
|
|
+ jQuery(this).addClass('hidden');
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ jQuery('.suggested-domains').removeClass('hidden');
|
|
|
|
|
+ }
|
|
|
|
|
+ var suggestionCount = 1;
|
|
|
|
|
+ jQuery.each(data.result, function (index, domain) {
|
|
|
|
|
+ var tld = domain.tld,
|
|
|
|
|
+ pricing = domain.pricing;
|
|
|
|
|
+ suggestions.find('li:first').clone(true, true).appendTo(suggestions);
|
|
|
|
|
+ var newSuggestion = suggestions.find('li.domain-suggestion').last();
|
|
|
|
|
+ newSuggestion.addClass('clone')
|
|
|
|
|
+ .find('span.domain').html(domain.sld).end()
|
|
|
|
|
+ .find('span.extension').html('.' + tld).end();
|
|
|
|
|
+
|
|
|
|
|
+ if (typeof pricing === 'string') {
|
|
|
|
|
+ newSuggestion.find('button.btn-add-to-cart').remove();
|
|
|
|
|
+ if (pricing != '') {
|
|
|
|
|
+ newSuggestion.find('button.domain-contact-support').removeClass('hidden').end()
|
|
|
|
|
+ .find('span.price').hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ newSuggestion.remove();
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ newSuggestion.find('button.btn-add-to-cart').attr('data-domain', domain.idnDomainName).end()
|
|
|
|
|
+ .find('span.price').html(pricing[Object.keys(pricing)[0]].register).end();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (suggestionCount <= 10) {
|
|
|
|
|
+ newSuggestion.removeClass('hidden');
|
|
|
|
|
+ }
|
|
|
|
|
+ suggestionCount++;
|
|
|
|
|
+ if (domain.group) {
|
|
|
|
|
+ newSuggestion.find('span.promo')
|
|
|
|
|
+ .addClass(domain.group)
|
|
|
|
|
+ .html(domain.group.toUpperCase())
|
|
|
|
|
+ .removeClass('hidden')
|
|
|
|
|
+ .end();
|
|
|
|
|
+ }
|
|
|
|
|
+ furtherSuggestions = suggestions.find('li.domain-suggestion.clone.hidden').length;
|
|
|
|
|
+ if (furtherSuggestions > 0) {
|
|
|
|
|
+ jQuery('div.more-suggestions').removeClass('hidden');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ jQuery('.domain-lookup-suggestions-loader').hide();
|
|
|
|
|
+ jQuery('#domainSuggestions').removeClass('hidden');
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(3, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (domainoption == 'transfer') {
|
|
|
|
|
+ jQuery('#resultDomainOption').val(domainoption);
|
|
|
|
|
+ var transfer = jQuery.post(
|
|
|
|
|
+ WHMCS.utils.getRouteUrl('/domain/check'),
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ type: 'transfer',
|
|
|
|
|
+ domain: sld + tld
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ transfer.done(function (data) {
|
|
|
|
|
+ if (typeof data != 'object' || data.result.length == 0) {
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ var result = jQuery('#primaryLookupResult'),
|
|
|
|
|
+ transfereligible = result.find('.transfer-eligible'),
|
|
|
|
|
+ transferPrice = result.find('.domain-price'),
|
|
|
|
|
+ transfernoteligible = result.find('.transfer-not-eligible'),
|
|
|
|
|
+ resultDomain = jQuery('#resultDomain'),
|
|
|
|
|
+ resultDomainPricing = jQuery('#resultDomainPricingTerm');
|
|
|
|
|
+ if (Object.keys(data.result).length === 0) {
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ result.removeClass('hidden').show();
|
|
|
|
|
+ transfernoteligible.show();
|
|
|
|
|
+ }
|
|
|
|
|
+ jQuery.each(data.result, function (index, domain) {
|
|
|
|
|
+ var pricing = domain.pricing;
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ result.removeClass('hidden').show();
|
|
|
|
|
+ if (domain.isRegistered) {
|
|
|
|
|
+ transfereligible.show();
|
|
|
|
|
+ transferPrice.show().find('.register-price-label').hide().end()
|
|
|
|
|
+ .find('.transfer-price-label').removeClass('hidden').show().end()
|
|
|
|
|
+ .find('span.price').html(pricing[Object.keys(pricing)[0]].transfer).end()
|
|
|
|
|
+ .find('button').attr('data-domain', domain.idnDomainName);
|
|
|
|
|
+ resultDomain.val(domain.domainName);
|
|
|
|
|
+ resultDomainPricing.val(Object.keys(pricing)[0]).attr('name', 'domainsregperiod[' + domain.domainName + ']');
|
|
|
|
|
+ btnDomainContinue.removeAttr('disabled');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ transfernoteligible.show();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(1, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (domainoption == 'owndomain' || domainoption == 'subdomain' || domainoption == 'incart') {
|
|
|
|
|
+
|
|
|
|
|
+ var otherDomain = jQuery.post(
|
|
|
|
|
+ WHMCS.utils.getRouteUrl('/domain/check'),
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ type: domainoption,
|
|
|
|
|
+ pid: pid,
|
|
|
|
|
+ domain: sld + tld
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ otherDomain.done(function (data) {
|
|
|
|
|
+ if (typeof data != 'object' || data.result.length == 0) {
|
|
|
|
|
+ jQuery('.domain-lookup-subdomain-loader').hide();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ jQuery.each(data.result, function (index, result) {
|
|
|
|
|
+ if (result.status === true) {
|
|
|
|
|
+ window.location = 'cart.php?a=confproduct&i=' + result.num;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ jQuery('#primaryLookupResult').removeClass('hidden').show().find('.domain-invalid').show();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(1, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (domainoption === 'existing_domain') {
|
|
|
|
|
+
|
|
|
|
|
+ sldInput = jQuery("#existing_domainsld option:selected");
|
|
|
|
|
+ sld = sldInput.text();
|
|
|
|
|
+ var splitDomain = sld.split('.');
|
|
|
|
|
+ sld = splitDomain[0];
|
|
|
|
|
+ splitDomain.splice(0, 1);
|
|
|
|
|
+ tld = '.' + splitDomain.join(".");
|
|
|
|
|
+
|
|
|
|
|
+ jQuery('.domain-lookup-other-loader').show();
|
|
|
|
|
+ jQuery('.domain-lookup-loader').show();
|
|
|
|
|
+
|
|
|
|
|
+ btnDomainContinue.addClass('hidden').attr('disabled', 'disabled');
|
|
|
|
|
+
|
|
|
|
|
+ var otherDomain = jQuery.post(
|
|
|
|
|
+ 'cart.php',
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ a: 'checkDomain',
|
|
|
|
|
+ type: "owndomain", //domainoption,
|
|
|
|
|
+ pid: pid,
|
|
|
|
|
+ wscheck: 1,
|
|
|
|
|
+ domain: sld + tld
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ otherDomain.done(function (data) {
|
|
|
|
|
+ if (typeof data !== 'object' || data.result.length === 0) {
|
|
|
|
|
+ jQuery('.domain-lookup-subdomain-loader').hide();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof data.result.wsres !== 'undefined' && data.result.wsres.length > 0) {
|
|
|
|
|
+ $(".errordomainnamepws").remove();
|
|
|
|
|
+ {/literal}
|
|
|
|
|
+ $('#frmProductDomainSelections').prepend('<div class="errordomainnamepws alert alert-danger"><strong>' + data.result.wsdomain + '</strong> {$EDLANG.errordomain}</div>');
|
|
|
|
|
+ {literal}
|
|
|
|
|
+ }
|
|
|
|
|
+ jQuery.each(data.result, function (index, result) {
|
|
|
|
|
+ if (result.status === true) {
|
|
|
|
|
+ window.location = 'cart.php?a=confproduct&i=' + result.num;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ jQuery('#primaryLookupResult').removeClass('hidden').show().find('.domain-invalid').show();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(1, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (domainoption === 'subexisting_domain') {
|
|
|
|
|
+ if ($("#subdomainexisting_domaindomains").val() === '') {
|
|
|
|
|
+ $('#subdomainexisting_domaindomains').tooltip('show');
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ jQuery('.domain-lookup-other-loader').show();
|
|
|
|
|
+ jQuery('.domain-lookup-loader').show();
|
|
|
|
|
+
|
|
|
|
|
+ btnDomainContinue.addClass('hidden').attr('disabled', 'disabled');
|
|
|
|
|
+ var ddsubdomain = $("#subexisting_domaindomainid").val();
|
|
|
|
|
+ var otherDomain = jQuery.post(
|
|
|
|
|
+ 'cart.php',
|
|
|
|
|
+ {
|
|
|
|
|
+ token: csrfToken,
|
|
|
|
|
+ a: 'checkDomain',
|
|
|
|
|
+ type: "owndomain", //domainoption,
|
|
|
|
|
+ pid: pid,
|
|
|
|
|
+ wscheck: 1,
|
|
|
|
|
+ domain: ddsubdomain
|
|
|
|
|
+ },
|
|
|
|
|
+ 'json'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ otherDomain.done(function (data) {
|
|
|
|
|
+ if (typeof data !== 'object' || data.result.length === 0) {
|
|
|
|
|
+ jQuery('.domain-lookup-subdomain-loader').hide();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof data.result.wsres !== 'undefined' && data.result.wsres.length > 0) {
|
|
|
|
|
+ $(".errordomainnamepws").remove();
|
|
|
|
|
+ {/literal}
|
|
|
|
|
+ $('#frmProductDomainSelections').prepend('<div class="errordomainnamepws alert alert-danger"><strong>' + data.result.wsdomain + '</strong> {$EDLANG.errordomain}</div>');
|
|
|
|
|
+ {literal}
|
|
|
|
|
+ }
|
|
|
|
|
+ jQuery.each(data.result, function (index, result) {
|
|
|
|
|
+ if (result.status === true) {
|
|
|
|
|
+ window.location = 'cart.php?a=confproduct&i=' + result.num;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ jQuery('.domain-lookup-primary-loader').hide();
|
|
|
|
|
+ jQuery('#primaryLookupResult').removeClass('hidden').show().find('.domain-invalid').show();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }).always(function () {
|
|
|
|
|
+ hasProductDomainLookupEnded(1, btnSearchObj);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ btnDomainContinue.removeClass('hidden');
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ </script>
|
|
|
|
|
+ <script>
|
|
|
|
|
+ $(document).ready(function () {
|
|
|
|
|
+ $("#subdomainexisting_domaindomains").on("keyup", function () {
|
|
|
|
|
+ if ($("#subdomainexisting_domaindomains").val() !== '') {
|
|
|
|
|
+ $('#subdomainexisting_domaindomains').tooltip('hide');
|
|
|
|
|
+ var oldvv = $("#subexisting_domainsld").find("option:selected").data("oldv");
|
|
|
|
|
+ $("#subexisting_domaindomainid").val($("#subdomainexisting_domaindomains").val() + '.' + oldvv);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#subexisting_domaindomainid").val('');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ $(".btn-submf").on("click", function () {
|
|
|
|
|
+ jQuery('#frmProductDomain').submit();
|
|
|
|
|
+ });
|
|
|
|
|
+ $("#subexisting_domainsld").on("change", function () {
|
|
|
|
|
+ if ($("#subdomainexisting_domaindomains").val() !== '') {
|
|
|
|
|
+ var oldvv = $("#subexisting_domainsld").find("option:selected").data("oldv");
|
|
|
|
|
+ $("#subexisting_domaindomainid").val($("#subdomainexisting_domaindomains").val() + '.' + oldvv);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#subexisting_domaindomainid").val('');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ </script>
|
|
|
|
|
+ {/literal}
|
|
|
|
|
+{/if}
|