Merge pull request #19989 from woocommerce/fix/obw-settings-hidden-fields-as-required

OBW: Set only applicable fields as required when enabling shipping zone
This commit is contained in:
Claudiu Lodromanean 2018-05-07 12:01:39 -07:00 committed by GitHub
commit ad85be2b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -110,9 +110,11 @@ jQuery( function( $ ) {
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-enable', function() {
var checked = $( this ).is( ':checked' );
var selectedMethod = $( '.wc-wizard-shipping-method-select .method' ).val();
$( this )
.closest( '.wc-wizard-service-item' )
.find( '.' + selectedMethod )
.find( '.shipping-method-required-field' )
.prop( 'required', checked );
} );