Adding inline JavaScript after wp_enqueue_scripts
i don’t know with version you use, but if you wan’t load stuff on the initialisation of js you can have it on file using js : ( function( wp ) { your stuff } )( window.wp ); if you really want inline use in php ; https://developer.wordpress.org/reference/functions/wp_add_inline_script/ wp_add_inline_script( ‘name_of_the_script_Woocommerce’, <script> your thing</script>, ‘after_or_before’ );