Fix the `wcadmin_product_update` Tracks event `menu_order` custom property value (#35605)

This commit is contained in:
Matt Sherman 2022-11-17 10:32:27 -05:00 committed by GitHub
parent ba0994fda5
commit 19058ed17c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Corrected the `wcadmin_product_update` Tracks event `menu_order` property value.

View File

@ -153,7 +153,7 @@ class WC_Products_Tracking {
if ( ! isBlockEditor ) {
tagsText = $( '[name=\"tax_input[product_tag]\"]' ).val();
if ( $( '#content' ).is( ':visible' ) ) {
description_value = $( '#content' ).val();
description_value = $( '#content' ).val();
} else if ( typeof tinymce === 'object' && tinymce.get( 'content' ) ) {
description_value = tinymce.get( 'content' ).getContent();
}
@ -171,7 +171,7 @@ class WC_Products_Tracking {
is_block_editor: isBlockEditor,
is_downloadable: $( '#_downloadable' ).is( ':checked' ) ? 'Yes' : 'No',
manage_stock: $( '#_manage_stock' ).is( ':checked' ) ? 'Yes' : 'No',
menu_order: $( '#menu_order' ).val() ? 'Yes' : 'No',
menu_order: parseInt( $( '#menu_order' ).val(), 10 ) !== 0 ? 'Yes' : 'No',
product_gallery: $( '#product_images_container .product_images > li' ).length,
product_image: $( '#_thumbnail_id' ).val() > 0 ? 'Yes' : 'No',
product_type: $( '#product-type' ).val(),