$(document).ready(function(){$("a.check-domain").click(function(){$(".DM-action").html(" ");var e=$("input.type-domain").val(),o={nl:{ext:"nl",price:"16.00",code:"1"},com:{ext:"nl",price:"16.00",code:"1"},net:{ext:"nl",price:"16.00",code:"1"},org:{ext:"nl",price:"16.00",code:"1"},info:{ext:"nl",price:"16.00",code:"1"},eu:{ext:"nl",price:"16.00",code:"1"},biz:{ext:"nl",price:"16.00",code:"1"},name:{ext:"nl",price:"16.00",code:"1"},nu:{ext:"nl",price:"16.00",code:"1"},am:{ext:"nl",price:"16.00",code:"1"}};Object.keys(o).forEach(function(a){console.log(a),$.ajax({type:"GET",url:"https://domain-availability-api.whoisxmlapi.com/api/v1?apiKey=at_c1lh4ZBRBYVcfz9Nk81oJVSnEjjpO&domainName="+e+"."+a,cache:!1,dataType:"json",success:function(n){$(".DM-row[data-domain-ext='"+a+"'] .DM-head").html(""+e+"."+a),console.log(n),console.log(n.DomainInfo),console.log(n.DomainInfo.domainAvailability),"UNAVAILABLE"==n.DomainInfo.domainAvailability?$(".DM-row[data-domain-ext='"+a+"'] .DM-action").html(" Verhuizen"):$(".DM-row[data-domain-ext='"+a+"'] .DM-action").html("Bestellen")}})})}),$("body").on("change","input.verhuizen-red",function(){var e=$(this).attr("domainname"),o=$(this).val();$(this).next("a").attr("webshop-description","Domainnaam: "+e+", verhuiscode: "+o),console.log($(this).next("a"))})}); $(document).ready(function(){ $('input[type="checkbox"]').click(function(){ var dataUrl = $(this).attr('data-url'); window.location.href = dataUrl; }); }); $('body').on('click', '.WebshopCart', function(){ var name = $(this).attr('webshop-name'); var amount = $(this).attr('webshop-amount'); var code = $(this).attr('webshop-code'); var description = $(this).attr('webshop-description'); var price = $(this).attr('webshop-price'); var type = $(this).attr('webshop-type'); $.ajax({ url: "themes/modules/webshop-cart.php?a=cart-put", data: {name:name, amount:amount, code:code, description:description, price:price, type:type}, cache: false, success: function(result){ $.ajax({ url: "themes/modules/webshop-cart.php?a=cart-get", cache: false, success: function(result){ $('.menu-cart-holder').html(result); alertify.success('Product is succesvol aan uw winelwagen toegevoegd!'); } }); } }); }); $('body').on('click', 'span.delete-product', function(){ var shopping_cart_index = $(this).attr("webshop-cart-id"); $.ajax({ url: "themes/modules/webshop-cart.php?a=cart-delete", data: {shopping_cart_index:shopping_cart_index}, cache: false, success: function(result){ $(".shopping-cart[webshop-cart-id='"+shopping_cart_index+"']").remove(); alertify.success('Product is succesvol uit winkelwagen verwijderd'); $.ajax({ url: "themes/modules/webshop-cart.php?a=update-checkout-price-rule", cache: false, success: function(result){ $(".shopping_cart_total_holder").html(result); }, error: function(data){ alertify.error('Chechout is niet geupdate!'); } }); } }); }); $('body').on('change', 'input.change-product-amount', function(){ var shopping_cart_index = $(this).attr("webshop-cart-id"); var product_amount = $(this).val(); console.log(shopping_cart_index, product_amount); $.ajax({ url: "themes/modules/webshop-cart.php?a=cart-amount", data: {shopping_cart_index:shopping_cart_index, product_amount:product_amount}, cache: false, success: function(result){ $('.menu-cart-holder').html(result); alertify.success('Product aantal is succesvol aangepast'); $.ajax({ url: "themes/modules/webshop-cart.php?a=update-checkout-rule", data: {shopping_cart_index:shopping_cart_index}, cache: false, success: function(result){ $(".shopping-cart[webshop-cart-id='"+shopping_cart_index+"']").html(result); }, error: function(data){ alertify.error('Chechout is niet geupdate!'); } }); $.ajax({ url: "themes/modules/webshop-cart.php?a=update-checkout-price-rule", cache: false, success: function(result){ $(".shopping_cart_total_holder").html(result); }, error: function(data){ alertify.error('Chechout is niet geupdate!'); } }); } }); }); $(document).ready(function(){ $(document).on('click', '.select-relatie-contact', function (){ getKlantGegevens($(this).attr("contact-id")); }); $(document).on('click', '.checkout-create-bestelling', function (){ setKlantGegevens(); }); }); function setKlantGegevens(){ var voornaam = $('.checkout-form-input[name="voornaam"]').val(); var achternaam = $('.checkout-form-input[name="achternaam"]').val(); var emailadres = $('.checkout-form-input[name="emailadres"]').val(); var telefoonnummer = $('.checkout-form-input[name="telefoonnummer"]').val(); var straatnaam = $('.checkout-form-input[name="straatnaam"]').val(); var nummer = $('.checkout-form-input[name="nummer"]').val(); var postcode = $('.checkout-form-input[name="postcode"]').val(); var plaatsnaam = $('.checkout-form-input[name="plaatsnaam"]').val(); $.ajax({ type: 'GET', cache : false, data: {voornaam: voornaam, achternaam: achternaam, emailadres: emailadres, telefoonnummer: telefoonnummer, straatnaam: straatnaam, nummer: nummer, postcode: postcode, plaatsnaam: plaatsnaam, }, dataType: "json", url: "themes/modules/api.php?action=setklantgegevens", success: function(data) { window.location.href = data.data.url; } }); } function getKlantGegevens(contactid){ $.ajax({ type: 'GET', cache : false, data: {contactid: contactid}, dataType: "json", url: "themes/modules/api.php?action=getklantgegevens", success: function(data) { $.each(data.data, function(index, value) { $('.checkout-form-input[name="voornaam"]').val(value.relatiebeheer_contacts_name); $('.checkout-form-input[name="achternaam"]').val(value.relatiebeheer_contacts_lastname); $('.checkout-form-input[name="emailadres"]').val(value.relatiebeheer_contacts_mail); $('.checkout-form-input[name="telefoonnummer"]').val(value.relatiebeheer_contacts_telefoon); $('.checkout-form-input[name="straatnaam"]').val(value.relatiebeheer_contacts_adres_straat); $('.checkout-form-input[name="nummer"]').val(value.relatiebeheer_contacts_adres_nummer); $('.checkout-form-input[name="postcode"]').val(value.relatiebeheer_contacts_adres_postcode); $('.checkout-form-input[name="plaatsnaam"]').val(value.relatiebeheer_contacts_adres_plaats); }); } }); } function alertify(content, type){ var timestamp = "_"+new Date().getTime(); $(".alertify-notifier").append("
"+content+"
"); $("."+timestamp).fadeIn(750).delay(4500).fadeOut(1400); setTimeout(function() { $("."+timestamp).remove(); }, 7500); }