1
|
|
|
function changeT(){jQuery(".js-widget-delivery-type").length&&jQuery(".js-widget-delivery-type").click(function(e){e.preventDefault(),console.log(this);var t=jQuery(this).attr("data-delivery-type");console.log("setted delivery type -> "+t),window.deliveryTypes=[t],ydwidget.cartWidget.changeDeliveryTypes()})}function ydMethodAdd(e,t,n){var i=jQuery("body").attr("class");if(i.indexOf(!1))setTimeout(function(){console.log("probably adminhtml -> "+t);var i=jQuery("dt:contains("+t+")"),a=i.next(),l=a.find("li:last");l.after('<li><input id="yd_delivery" type="radio" class="radio" name="shipping_method"><label class="js-widget-delivery-type" id="yd_label" data-ydwidget-open data-delivery-type="'+e+'" for="yd_delivery">'+n+"</label></li>"),changeT()},1e3);else{var a=jQuery("#checkout-shipping-method-load dt:contains("+t+")");if(!a.length>0)var l=jQuery("#onestepcheckout-shipping-methods div:contains("+t+")"),r=l.next(),d=r.find("li:last");else var u=a.next(),d=u.find("ul li:last");d.after('<input id="yd_delivery" type="radio" class="radio" name="shipping_method"><label class="js-widget-delivery-type" id="yd_label" data-ydwidget-open data-delivery-type="'+e+'" for="yd_delivery">'+n+"</label>")}}jQuery(function(){function e(e){jQuery('input[name="'+e+'[city]"]').autocomplete({source:function(t,n){jQuery.ajax({url:MYGENTO_YANDEXDELIVERY_BASE_URL+"/yandexdelivery/index/json/?callback=?",dataType:"jsonp",data:{search:function(){return jQuery('input[name="'+e+'[city]"]').val()},type:"locality"},success:function(e){n(jQuery.map(e.jsonresult,function(e){return{label:e.label,value:e.value}}))}})},minLength:3,close:function(){},select:function(t,n){jQuery('input[name="'+e+'[city]"]').val(n.item.value)}}),jQuery('input[name="'+e+'[street][]"]').autocomplete({source:function(t,n){jQuery.ajax({url:MYGENTO_YANDEXDELIVERY_BASE_URL+"/yandexdelivery/index/json/?callback=?",dataType:"jsonp",data:{city:function(){return jQuery('input[name="'+e+'[city]"]').val()},search:function(){return jQuery('input[name="'+e+'[street][]"]').val()},type:"street"},success:function(e){n(jQuery.map(e.jsonresult,function(e){return{label:e.label,value:e.value}}))}})},minLength:3,close:function(){},select:function(t,n){jQuery('input[name="'+e+'[street]"]').val(n.item.value)}})}e("billing"),e("shipping")}); |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.