Fix duplicated global attribute (#37109)

* Add fix

* Add changelog

---------

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
Fernando Marichal 2023-03-07 18:04:17 -03:00 committed by GitHub
parent 8786c19b74
commit a23b2cf415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fix duplicated global attribute

View File

@ -652,9 +652,15 @@ jQuery( function ( $ ) {
attribute_row_indexes(); attribute_row_indexes();
} }
$parent.remove();
if ( if (
! $( '.woocommerce_attribute_data' ).is( ':visible' ) && ! $( '.woocommerce_attribute_data' ).is( ':visible' ) &&
! $( 'div.add-global-attribute-container' ).hasClass( 'hidden' ) ! $( 'div.add-global-attribute-container' ).hasClass(
'hidden'
) &&
$( '.product_attributes' ).find( 'input, select, textarea' )
.length === 0
) { ) {
toggle_add_global_attribute_layout(); toggle_add_global_attribute_layout();
} }