lucavigg
Forum Replies Created
-
For anyone still experiencing this, I note the update is now offered but not yet tested on WordPress 6.8.
@avs22 I was thinking of adding this to code snippets:
function enqueue_checkout_fix_script() {
if (is_checkout()) {
wp_enqueue_script(
'checkout-fix',
get_template_directory_uri() . '/js/checkout-fix.js',
array('jquery'),
'1.0',
true
);
}
}
add_action('wp_enqueue_scripts', 'enqueue_checkout_fix_script');and then this to /js/checkout-fix.js in the wp-content/themes/template folder:
jQuery(document).ready(function($) {
if (!sessionStorage.getItem('checkoutReloaded')) {
setTimeout(function() {
window.location.reload();
sessionStorage.setItem('checkoutReloaded', 'true');
}, 400);
}
});Not hugely confident with code snippets or javascript but as it’s a test site, I’ll see what happens. I’m hoping it won’t mess with the shipping cost estimate part of the page, which seems to update after every keystroke.
We’ve just hit this problem on a new website that’s being tested. Just out of interest, how did you implement the page reload after 300ms? Was it a code snippet and a separate js file? I presume the fix that’s been applied will go into the next release and we have to use the refresh fix for the time being.
Thanks.
Forum: Fixing WordPress
In reply to: Dynamic PDF Links on single pageThanks. I’ll take a look.