diff --git a/assets/js/frontend/checkout.js b/assets/js/frontend/checkout.js index 75a5c7110c8..d367bd791a5 100644 --- a/assets/js/frontend/checkout.js +++ b/assets/js/frontend/checkout.js @@ -77,10 +77,12 @@ jQuery( function( $ ) { $payment_methods.eq(0).prop( 'checked', true ); } - if ( $payment_methods.length > 1 ) { + // Get name of new selected method. + var checkedPaymentMethod = $payment_methods.filter( ':checked' ).eq(0).prop( 'id' ); + if ( $payment_methods.length > 1 ) { // Hide open descriptions. - $( 'div.payment_box' ).filter( ':visible' ).slideUp( 0 ); + $( 'div.payment_box:not(".' + checkedPaymentMethod + '")' ).filter( ':visible' ).slideUp( 0 ); } // Trigger click event for selected method