bug with countdown timers
-
Hello,
I’m trying to create countdown timer as HTML block to use in popup. The counter is not visible in the popup and the browser console shows the following error
Uncaught ReferenceError: moment is not defined
Attachments:
You must be
logged in to view attached files.
Hello,
Could you please disable all plugins that are not related to our theme and provide us your admin access so we could check it?
Thank you in advance
all plugins not related to your theme has been deactivated and a new user has been created and credentials added to private content
Try to add the following PHP code snippet to the child theme functions.php file to fix this
add_action(
'wp_enqueue_scripts',
function() {
wp_enqueue_script( 'woodmart-countdown' );
},
10001
);
Thanks, now it works. I’m just wondering if this is something that will be included by default in the next update or this is just how it works? I mean should I keep this in my functions.php forever ?
Yes, you need to keep the code if you want to use the countdown in the promo popup. Or you can enable Combine JS
option in Theme Settings -> Performance.