1function special_date_minimum(date){ 2 let data = { action: 'special_date_minimum', date: date }; 3 let result = null; 4 $.ajax({ 5 method: 'GET', 6 url : '/assets/ajax/delivery.ajax.php', 7 data: data, 8 dataType: 'json', 9 async: false, 10 success: function(data){ 11 result = data; 12 } 13 }); 14 return result; 15} 16 17function get_special_dates(){ 18 $.ajax({ 19 method: "POST", 20 url: "/assets/ajax/delivery.ajax.php", 21 data: { action: "get_special_dates" }, 22 dataType: "json", 23 success: function( data ){ 24 $.each(data.rows, function(i, e){ 25 var min = parseFloat(e.minimum); 26 var price = parseFloat(data.price); 27 if(price < min){ 28 $('.delivery-date input[value="'+ e.day +'"]').prop('checked', false).change(); 29 $('.delivery-date input[value="'+ e.day +'"]').prop('disabled', true).change(); 30 } 31 }); 32 }, 33 }); 34} 35 36function specialDateCheck(date_val){ 37 //let date_val = $('input[name="delivery_date"]:checked').val(); 38 39 let data = special_date_minimum(date_val); 40 if(data.found === true && data.min_exceeded === false){ 41 42 let product_url = data.product_url + '&upgrade_product=1&date=' + encodeURI(date_val); 43 let category_link = data.url + '?replace_product=1'; 44 localStorage.setItem('gsd_product_url', product_url); 45 localStorage.setItem('gsd_category_url', category_link); 46 47 let dateminval = Math.trunc(data.min); 48 $("span#date-min-val").text(dateminval); 49 if (data.product_max >= data.min) { 50 $("p#upgrade-product").removeClass("hidden"); 51 } else { 52 $("p#upgrade-product").addClass("hidden"); 53 } 54 55 $("a#product_url").prop("href", product_url); 56 $("a#category_link").prop("href", category_link); 57 58 //$.pdialog("date-minimum-dlg"); 59 return false; 60 } 61 62 return true; 63} 64 65function getFlexDeliveryOption(timestamp, date){ 66 $(document).find('.flex-container').html(''); 67 let flexData = null; 68 const data = { 69 action : 'get_flex_delivery_options', 70 timestamp : timestamp, 71 date: date 72 } 73 $.ajax({
74 type: 'GET', 75 url: '/assets/ajax/delivery.ajax.php', 76 data: data, 77 dataType: 'json', 78 async: false, 79 success: function(data){ 80 if(data.success){ 81 flexData = data.flexData; 82 } 83 } 84 }); 85 86 return flexData; 87} 88 89function validateZip(e){ 90 let starts_with_digit = (/\b\d{5}\b/).test(e.val()); 91 if(starts_with_digit){ 92 e.val(e.val().substring(0, 5)); 93 e.attr('maxlength', '5'); 94 } else { 95 e.attr('maxlength', '7'); 96 } 97} 98 99function non_shippable_date_check(date) { 100 $.ajax({ 101 type: 'GET', 102 url: '/assets/ajax/delivery.ajax.php', 103 data: {action: 'non_shippable_date_check', date: date}, 104 dataType: 'json', 105 async: false, 106 success: function(data){ 107 if(data.is_non_shippable_date){ 108 $.pdialog("date-non-shippable"); 109 } else { 110 if (!specialDateCheck(date)) { 111 $.pdialog("date-minimum-dlg"); 112 } 113 } 114 } 115 }); 116}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.