Hi there!
On the checkout page of Woo Commerce, I would like to move the error notification bar (ul.woocommerce-error) to the top of the page, above the “Returning Customer?” box. Could you please advise me?
Thanks for your help!
Hey perfectword,
Can you post a link to your site? so we can take a closer look.
Best regards,
Nikko
Hi – we have a similar problem.
When the customer forgets to tick the “I accept… ” box, the error message appears on top though the page is not moved there. So I’d prefer that the customer sees much quicker where the problem is. Is there a way to move the error message to a visible part of the checkout page?
Site and Info below.
Cheers,
Ralph
Hi,
Thanks for the screenshot and the link to your site, when I test this on your site the page scrolls up to the error for me, using Windows & Chrome.
But this script will copy the error message to under the checkout button if your page is not scrolling.
Try adding this code to the end of your functions.php file in Appearance ▸ Editor:
function woocommerce_NoticeGroup_checkout() { ?>
<script>
(function ($) {
$('#place_order').on('click',function(){
setTimeout(function(){
if ($('.woocommerce-checkout').children().hasClass('woocommerce-NoticeGroup-checkout')) {
$( ".woocommerce-NoticeGroup-checkout" ).clone().insertAfter( "#place_order" ).css({'margin-top':'80px'});
} else {}
},1000);
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'woocommerce_NoticeGroup_checkout');
Best regards,
Mike
Thank you, Mike, This helps a lot. :-) Much appreciated!
Best regards,
Ralph
Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike