Use var instead of const/let because IE11

This commit is contained in:
Rebecca Scott 2020-03-27 14:51:26 +10:00
parent 17d5f42228
commit 5a45d6a3f2
1 changed files with 4 additions and 4 deletions

View File

@ -54,16 +54,16 @@ class WC_Products_Tracking {
wc_enqueue_js( wc_enqueue_js(
" "
if ( $( 'h1.wp-heading-inline' ).text().trim() === 'Edit product') { if ( $( 'h1.wp-heading-inline' ).text().trim() === 'Edit product') {
const initialStockValue = $( '#_stock' ).val(); var initialStockValue = $( '#_stock' ).val();
let hasRecordedEvent = false; var hasRecordedEvent = false;
$( '#publish' ).click( function() { $( '#publish' ).click( function() {
if ( hasRecordedEvent ) { if ( hasRecordedEvent ) {
return; return;
} }
const currentStockValue = $( '#_stock' ).val(); var currentStockValue = $( '#_stock' ).val();
const properties = { var properties = {
product_type: $( '#product-type' ).val(), product_type: $( '#product-type' ).val(),
is_virtual: $( '#_virtual' ).is( ':checked' ) ? 'Y' : 'N', is_virtual: $( '#_virtual' ).is( ':checked' ) ? 'Y' : 'N',
is_downloadable: $( '#_downloadable' ).is( ':checked' ) ? 'Y' : 'N', is_downloadable: $( '#_downloadable' ).is( ':checked' ) ? 'Y' : 'N',