When the place order button is clicked on my woocommerce site it takes a few seconds to complete the order, the user can see that the wheel turning to show the script is running. I am looking for a solution to add the text “please wait” under the turning wheel, so that my customer doesn’t leave.
I tried to add this code as a hook that was here on the site, but it doesn’t work for me.
Thank you advance for help. I’m sure it will help others…
add_action( 'wp_footer', 'custom_checkout_jquery_script' );
function custom_checkout_jquery_script() {
if ( is_checkout() && ! is_wc_endpoint_url() ) :
?>
<script type="text/javascript">
jQuery( function($){
jQuery('form.checkout').on('submit', function(event) {
jQuery('button#place_order').text('Please Wait');
event.preventDefault();
});
});
</script>
<?php
endif;
}
Intel Value is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.