Replacing entire tag with shortcode – JavaScript [duplicate]

This looks like javascript. do_shortcode is a php function. I’m not sure the full context, but at the very least, you need to wrap your php function in php tags like this and add an echo: <?php // Start of php file ?> <script> var stockcounter = document.getElementsByClassName(“stock in-stock”); if(stockcounter[0].innerHTML==’0 in stock’) { //Displays timer … Read more

currentURL is not defined

The way I found at the moment to fix that was disabling the ajax from checkout /** Disable Ajax Call from WooCommerce added in functions.php*/ add_action( ‘wp_enqueue_scripts’, ‘dequeue_woocommerce_cart_fragments’, 11); function dequeue_woocommerce_cart_fragments() { if (is_front_page()) wp_dequeue_script(‘wc-cart-fragments’); } function disable_checkout_script(){ wp_dequeue_script( ‘wc-checkout’ ); } add_action( ‘wp_enqueue_scripts’, ‘disable_checkout_script’ );