1function hide_non_applicable_coupons() { 2 var coupon_elements = document.getElementsByClassName( 'cart-discount' ); 3 4 for ( var i = 0; i < coupon_elements.length; i++ ) { 5 if ( 0 !== coupon_elements[i].getElementsByClassName( 'wcs-hidden-coupon' ).length ) { 6 coupon_elements[i].style.display = 'none'; 7 } 8 } 9} 10 11hide_non_applicable_coupons(); 12 13jQuery( document ).ready( function( $ ) { 14 $( document.body ).on( 'updated_cart_totals updated_checkout', function() { 15 hide_non_applicable_coupons(); 16 } ); 17 18 $( '.payment_methods [name="payment_method"]' ).click( function() { 19 if ( $( this ).hasClass( 'supports-payment-method-changes' ) ) { 20 $( '.update-all-subscriptions-payment-method-wrap' ).show(); 21 } else { 22 $( '.update-all-subscriptions-payment-method-wrap' ).hide(); 23 } 24 } ); 25} );
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.