1jQuery( document ).ready( 2 function($) { 3 let is_product_type = acf_wc_extension.is_product_type; 4 if ( is_product_type === 'variable' ) { 5 let $inputVariationID = jQuery( 'input.variation_id' ); 6 let $variationsForm = jQuery( '.variations_form' ); 7 let $productVariations = $variationsForm.data( 'product_variations' ); 8 $inputVariationID.change( 9 function () { 10 let variation_id = $inputVariationID.val(); 11 if ( '' !== variation_id) { 12 $.each( 13 $productVariations, 14 function (index, value) { 15 if (parseInt( variation_id ) === parseInt( value.variation_id )) { 16 if( $( '.woocommerce-tabs .wc-tabs' ). length > 0 ) { 17 let wcActiveTab = $('.woocommerce-tabs .wc-tabs li.active') 18 let wcActiveTabLink = wcActiveTab?.children('a'); 19 let wcTabID = wcActiveTabLink?.attr('aria-controls'); 20 if (wcTabID.includes('acf_variation_wc_data')) { 21 let acfTabIDString = wcTabID.split('acf_variation_wc_data_'); 22 let acfTabID = acfTabIDString[acfTabIDString.length - 1]; 23 let variationObjectID = 'acf_variation_data_' + acfTabID; 24 $.each( 25 value, 26 function (index, option) { 27 if (variationObjectID === index) { 28 jQuery('.acf-product-variation-data').html(option); 29 } 30 } 31 ); 32 } 33 } 34 35 let productVariationData = $('.acf-product-variation-data-wrapper'); 36 if( productVariationData.length > 0 ) { 37 let wcAcfData = productVariationData.children(); 38 $.each( 39 value, 40 function (index, option) { 41 wcAcfData.each(function() { 42 let AcfVariationDataId = $(this).data( 'aria-controls'); 43 if ( AcfVariationDataId === index) { 44 let AcfVariationDataObject = jQuery( '.' + AcfVariationDataId ); 45 AcfVariationDataObject.parent().show(); 46 AcfVariationDataObject.html( option ); 47 } 48 }); 49 } 50 ); 51 } 52 } 53 } 54 ); 55 } else { 56 $('.acf-product-variation-shortcode-data').html(''); 57 $('.acf-product-variation-data-wrapper').children().hide(); 58 } 59 } 60 ); 61 62 $( document ).on( 63 'click', 64 'ul.wc-tabs li a', 65 function (){ 66 $inputVariationID.trigger( 'change' ); 67 } 68 ); 69 } 70 } 71);
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.