Switch to general panel when virtual is enabled and on shipping tab closes #28267

This commit is contained in:
roykho 2020-11-25 10:12:24 -08:00
parent 97c0a62f7e
commit beebbb8e25
No known key found for this signature in database
GPG Key ID: 7B36C0EA25795714
1 changed files with 5 additions and 0 deletions

View File

@ -146,6 +146,11 @@ jQuery( function( $ ) {
}
if ( is_virtual ) {
$( '.show_if_virtual' ).show();
// If user enables virtual while on shipping tab, switch to general tab.
if ( $( '.shipping_options.shipping_tab' ).hasClass( 'active' ) ) {
$( '.general_options.general_tab > a' ).trigger( 'click' );
}
}
$( '.show_if_' + product_type ).show();