1jQuery( function( $ ) { 2 3 $( document ).on( 'click', 'a.credit-note_xml', function( e ) { 4 let href = $( this ).attr( 'href' ); 5 if ( ! href ) { 6 return; 7 } 8 9 let url; 10 try { 11 url = new URL( href, window.location.origin ); 12 } catch ( err ) { 13 return; 14 } 15 16 let orderId = url.searchParams.get( 'order_ids' ); 17 if ( ! orderId ) { 18 return; 19 } 20 21 e.preventDefault(); 22 23 $.ajax( { 24 url: woocommerce_pdf_pro_my_account.ajaxurl, 25 type: 'POST', 26 dataType: 'json', 27 data: { 28 action: 'wpo_ips_get_refund_order_ids', 29 order_ids: [ orderId ], 30 security: woocommerce_pdf_pro_my_account.nonce, 31 }, 32 success: function( response ) { 33 if ( response && response.success && response.data && response.data.refund_ids && response.data.refund_ids.length ) { 34 $.each( response.data.refund_ids, function( i, id ) { 35 url.searchParams.set( 'order_ids', id ); 36 window.open( url.toString(), '_blank' ); 37 } ); 38 } else { 39 alert( ( response && response.data && response.data.message ) || woocommerce_pdf_pro_my_account.error_no_refunds_found ); 40 } 41 }, 42 error: function() { 43 alert( woocommerce_pdf_pro_my_account.error_fetching_refund_ids ); 44 }, 45 } ); 46 } ); 47 48} );
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.