1jQuery(document).ready(function($) { 2 function conditional_payments_trigger() { 3 if ( typeof conditional_payments_settings != 'undefined' ) { 4 $.each( conditional_payments_settings.name_address_fields, function( index, value ) { 5 $( document.body ).on( 'change', 'input[name="' + value + '"]', function() { 6 $( document.body ).trigger( 'update_checkout' ); 7 } ); 8 9 if ( value.indexOf('shipping_') !== -1 ) { 10 var billingValue = value.replace( 'shipping', 'billing' ); 11 if ( $.inArray( billingValue, conditional_payments_settings.name_address_fields ) === -1 ) { 12 $( document.body ).on( 'change', 'input[name="' + billingValue + '"]', function() { 13 $( document.body ).trigger( 'update_checkout' ); 14 } ); 15 } 16 } 17 } ); 18 } 19 } 20 conditional_payments_trigger(); 21 22 /** 23 * Trigger checkout update when changing payment method 24 */ 25 $( document.body ).on( 'change', 'input[name="payment_method"]', function() { 26 if ( conditional_payments_settings.disable_payment_method_trigger == '1' ) { 27 return; 28 } 29 30 $( document.body ).trigger( 'update_checkout' ); 31 } ); 32});
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.