Find the correct form element to update.

Previously it just found the first one, which made the second checkbox buggy.
This commit is contained in:
Peter Fabian 2020-01-31 12:45:08 +01:00
parent e87cea8688
commit b85d314d5d
1 changed files with 4 additions and 1 deletions

View File

@ -168,7 +168,10 @@ 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();
var selectedMethod = $( this )
.closest( '.wc-wizard-service-item' )
.find( '.wc-wizard-shipping-method-select .method' )
.val();
$( this )
.closest( '.wc-wizard-service-item' )