diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index cfa19ca1d9f..1c15db1ba67 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -447,32 +447,32 @@ jQuery( function( $ ) { * @return {Object} */ get_variations_fields: function( fields ) { - + var data = {}; - - $( ':input', fields ).each( function(index, elem) { - - var $input = $(elem); - + + $( ':input', fields ).each( function( index, elem ) { + + var $input = $( elem ); + // Bypass inputs without name att - if (!elem.name) { + if ( ! elem.name ) { return; } - + // Bypass non-checked checkboxes and radio buttons. - if (($input.is(':radio') || $input.is(':checkbox')) && !$input.is(':checked')) { + if ( ( $input.is( ':radio' ) || $input.is( ':checkbox' ) ) && ! $input.is( ':checked' ) ) { return; } - + // Bypass disabled fields. - if (true === $input.prop('disabled')) { + if ( true === $input.prop( 'disabled' ) ) { return; } - - data[elem.name] = elem.value; - + + data[ elem.name ] = elem.value; + }); - + $( '.variations-defaults select' ).each( function( index, element ) { var select = $( element ); data[ select.attr( 'name' ) ] = select.val();