Trouble with check - code failure
Posted by:
einrum
Jan 18, 2021 at 13:51 (3 year ago)
Hallo
I have another trouble with oculus. On the check out page i got a lot of code from the system with billing shipping and other codes.
var ss_jq = jQuery.noConflict(); ss_jq( document ).ready( function($){ //Set limits on address fields if($('#billing_country').val() == 'AU' || $('#shipping_country').val() == 'AU' ){ $('#billing_address_1').attr({ maxLength : 30 }); $('#billing_address_2').attr({ maxLength : 30 }); $('#billing_company').attr({ maxLength : 30 }); $('#billing_first_name').attr({ maxLength : 30 }); $('#billing_last_name').attr({ maxLength : 30 }); $('#billing_postcode').attr({ maxLength : 4 }); $('#billing_phone').attr({ maxLength : 10 }); $('#shipping_address_1').attr({ maxLength : 30 }); $('#shipping_address_2').attr({ maxLength : 30 }); $('#shipping_company').attr({ maxLength : 30 }); $('#shipping_first_name').attr({ maxLength : 30 }); $('#shipping_last_name').attr({ maxLength : 30 }); $('#shipping_postcode').attr({ maxLength : 4 }); $('#shipping_phone').attr({ maxLength : 10 }); } $("#shipping_postcode, #billing_postcode").autocomplete( { source: function( request, response ) { $.ajax({ type: 'POST', url: ajaxurl, dataType: "json", data: { 'action': 'smartsend_locations', 'term' : request.term, 'searchType' : 'suburb' }, success: function( data ) { response($.map(data, function(itemm) { return { label: itemm[0] +' '+itemm[1] +' '+itemm[2], value: itemm[2], id: itemm[0] } })); }, error: function( dataa ) { console.log("Error"); console.log(dataa); } }); }, delay: 500, minLength: 3, json: true, cache: true, autoFocus: true, select: function( event, ui ) { var id = ui.item.id; var value = ui.item.value; $("#shipping_postcode").val(value); $("#billing_city").val(id); $("#shipping_city").val(id); $("#billing_postcode").val(value); }, open: function(e, ui){ }, close: function() { $('body').trigger('update_checkout'); } }); $("#shipping_city, #billing_city").autocomplete( { source: function( request, response ) { $.ajax({ type: 'POST', url: ajaxurl, dataType: "json", data: { 'action': 'smartsend_locations', 'term' : request.term, 'searchType' : 'suburb' }, success: function( data ) { response($.map(data, function(itemm) { return { label: itemm[0] +' '+itemm[1] +' '+itemm[2], value: itemm[0], id: itemm[2] } })); }, error: function( dataa ) { console.log("Error"); console.log(dataa); } }); }, delay: 500, minLength: 3, json: true, cache: true, autoFocus: true, select: function( event, ui ) { var id = ui.item.id; var value = ui.item.value; $("#shipping_postcode").val(id); $("#billing_city").val(value); $("#shipping_city").val(value); $("#billing_postcode").val(id); }, open: function(e, ui){ }, close: function() { $('body').trigger('update_checkout'); } }); $("#billing_country, #shipping_country").on("change", function() { if ($(this).val() == 'AU') { $('#billing_address_1').attr({ maxLength : 30 }); $('#billing_address_2').attr({ maxLength : 30 }); $('#billing_company').attr({ maxLength : 30 }); $('#billing_first_name').attr({ maxLength : 30 }); $('#billing_last_name').attr({ maxLength : 30 }); $('#billing_postcode').attr({ maxLength : 4 }); $('#billing_phone').attr({ maxLength : 10 }); $('#shipping_address_1').attr({ maxLength : 30 }); $('#shipping_address_2').attr({ maxLength : 30 }); $('#shipping_company').attr({ maxLength : 30 }); $('#shipping_first_name').attr({ maxLength : 30 }); $('#shipping_last_name').attr({ maxLength : 30 }); $('#shipping_postcode').attr({ maxLength : 4 }); $('#shipping_phone').attr({ maxLength : 10 }); } else { $('#billing_address_1').removeAttr("maxLength"); $('#billing_address_2').removeAttr("maxLength"); $('#billing_company').removeAttr("maxLength"); $('#billing_first_name').removeAttr("maxLength"); $('#billing_last_name').removeAttr("maxLength"); $('#billing_postcode').removeAttr("maxLength"); $('#billing_phone').removeAttr("maxLength"); $('#shipping_address_1').removeAttr("maxLength"); $('#shipping_address_2').removeAttr("maxLength"); $('#shipping_company').removeAttr("maxLength"); $('#shipping_first_name').removeAttr("maxLength"); $('#shipping_last_name').removeAttr("maxLength"); $('#shipping_postcode').removeAttr("maxLength"); $('#shipping_phone').removeAttr("maxLength"); } }); });
What do we do about that
I have another trouble with oculus. On the check out page i got a lot of code from the system with billing shipping and other codes.
var ss_jq = jQuery.noConflict(); ss_jq( document ).ready( function($){ //Set limits on address fields if($('#billing_country').val() == 'AU' || $('#shipping_country').val() == 'AU' ){ $('#billing_address_1').attr({ maxLength : 30 }); $('#billing_address_2').attr({ maxLength : 30 }); $('#billing_company').attr({ maxLength : 30 }); $('#billing_first_name').attr({ maxLength : 30 }); $('#billing_last_name').attr({ maxLength : 30 }); $('#billing_postcode').attr({ maxLength : 4 }); $('#billing_phone').attr({ maxLength : 10 }); $('#shipping_address_1').attr({ maxLength : 30 }); $('#shipping_address_2').attr({ maxLength : 30 }); $('#shipping_company').attr({ maxLength : 30 }); $('#shipping_first_name').attr({ maxLength : 30 }); $('#shipping_last_name').attr({ maxLength : 30 }); $('#shipping_postcode').attr({ maxLength : 4 }); $('#shipping_phone').attr({ maxLength : 10 }); } $("#shipping_postcode, #billing_postcode").autocomplete( { source: function( request, response ) { $.ajax({ type: 'POST', url: ajaxurl, dataType: "json", data: { 'action': 'smartsend_locations', 'term' : request.term, 'searchType' : 'suburb' }, success: function( data ) { response($.map(data, function(itemm) { return { label: itemm[0] +' '+itemm[1] +' '+itemm[2], value: itemm[2], id: itemm[0] } })); }, error: function( dataa ) { console.log("Error"); console.log(dataa); } }); }, delay: 500, minLength: 3, json: true, cache: true, autoFocus: true, select: function( event, ui ) { var id = ui.item.id; var value = ui.item.value; $("#shipping_postcode").val(value); $("#billing_city").val(id); $("#shipping_city").val(id); $("#billing_postcode").val(value); }, open: function(e, ui){ }, close: function() { $('body').trigger('update_checkout'); } }); $("#shipping_city, #billing_city").autocomplete( { source: function( request, response ) { $.ajax({ type: 'POST', url: ajaxurl, dataType: "json", data: { 'action': 'smartsend_locations', 'term' : request.term, 'searchType' : 'suburb' }, success: function( data ) { response($.map(data, function(itemm) { return { label: itemm[0] +' '+itemm[1] +' '+itemm[2], value: itemm[0], id: itemm[2] } })); }, error: function( dataa ) { console.log("Error"); console.log(dataa); } }); }, delay: 500, minLength: 3, json: true, cache: true, autoFocus: true, select: function( event, ui ) { var id = ui.item.id; var value = ui.item.value; $("#shipping_postcode").val(id); $("#billing_city").val(value); $("#shipping_city").val(value); $("#billing_postcode").val(id); }, open: function(e, ui){ }, close: function() { $('body').trigger('update_checkout'); } }); $("#billing_country, #shipping_country").on("change", function() { if ($(this).val() == 'AU') { $('#billing_address_1').attr({ maxLength : 30 }); $('#billing_address_2').attr({ maxLength : 30 }); $('#billing_company').attr({ maxLength : 30 }); $('#billing_first_name').attr({ maxLength : 30 }); $('#billing_last_name').attr({ maxLength : 30 }); $('#billing_postcode').attr({ maxLength : 4 }); $('#billing_phone').attr({ maxLength : 10 }); $('#shipping_address_1').attr({ maxLength : 30 }); $('#shipping_address_2').attr({ maxLength : 30 }); $('#shipping_company').attr({ maxLength : 30 }); $('#shipping_first_name').attr({ maxLength : 30 }); $('#shipping_last_name').attr({ maxLength : 30 }); $('#shipping_postcode').attr({ maxLength : 4 }); $('#shipping_phone').attr({ maxLength : 10 }); } else { $('#billing_address_1').removeAttr("maxLength"); $('#billing_address_2').removeAttr("maxLength"); $('#billing_company').removeAttr("maxLength"); $('#billing_first_name').removeAttr("maxLength"); $('#billing_last_name').removeAttr("maxLength"); $('#billing_postcode').removeAttr("maxLength"); $('#billing_phone').removeAttr("maxLength"); $('#shipping_address_1').removeAttr("maxLength"); $('#shipping_address_2').removeAttr("maxLength"); $('#shipping_company').removeAttr("maxLength"); $('#shipping_first_name').removeAttr("maxLength"); $('#shipping_last_name').removeAttr("maxLength"); $('#shipping_postcode').removeAttr("maxLength"); $('#shipping_phone').removeAttr("maxLength"); } }); });
What do we do about that