newsletter emailing

Stay on top with regular WordPress updates.

Subscribe to our newsletter(s) and get the latest stories in your mailbox!

How to Remove the Default Pre-selected Shipping Method on the Checkout Page in WooCommerce?

Date:

By default any one of the WooCommerce shipping methods is always pre-selected on both the cart and checkout pages. Do you want to bypass this preselection and always show unselected shipping methods?

The code snippet below will help to clear the default selected shipping methods and show unselected shipping method options on the checkout page. This is beneficial for customers to avoid confusion where they actually forget to input the correct shipping method and also allows customers to make their own choices.

add_action( ‘woocommerce_before_checkout_form’, ‘ts_uncheck_default_shipping_method’ ); function ts_uncheck_default_shipping_method() { WC()->session->set( ‘chosen_shipping_methods’, null ); wc_enqueue_js( ” $( document.body ).one( ‘updated_checkout’, function()

This is the first part of the article

How to Remove the Default Pre-selected Shipping Method on the Checkout Page in WooCommerce?

wpforms banner 01 468x602x