Table of Contents
Here is how you can easily uncheck the preselected default payment method in WooCommerce. This is tested working with the latest version of WooCommerce.
In fact it's quite simple to disable the default payment method with WooCommerce and to force the user to make a choice.
This is the result we are looking for:
Disabling the default payment method on WooCommerce checkout page
All you need to do to achieve this is to add the following JavaScript to your project, and be certain that it loads on your WooCommerce checkout page.
You can make use of the code snippet manager of your choice.
document.addEventListener('DOMContentLoaded', function () { $ = jQuery; $(document).on('updated_checkout', function () { document.querySelector('.woocommerce-checkout-payment [name="payment_method"]').checked = false; document.querySelector('.payment_box').style.display = 'none'; document.getElementById('place_order').innerHTML = 'Choose Payment Method'; }); });
Adjusting the code for the disabled default Payment Method snippet
The only part you will want to adjust is where it says 'Choose Payment Method'.
Change to whatever you wish your payment button to say before the user has made a choice.
Finally, enjoy your WooCommerce checkout without any default option selected
I hope you have enjoyed this tutorial and found it helpful!
Cheers!
Element.how also provides premium tutorials showing awesome advanced designs, check them out here.
And get exclusive Elementor related discounts here
Checkout the Elementor Addon Finder directly