OBW: Set only applicable fields as required when enabling shipping zone

This commit is contained in:
Paul Dechov 2018-05-07 11:32:00 -04:00
parent 8d6bbabc58
commit a765d87979
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 );
} );