How to uncheck "Ship to different address" by default from the Checkout page of Woocommerce

Online trade is gaining more and more land, and WooCommerce is one of the favorite platforms of web developers for creating online stores.

A successful online store is the one who knows how to highlight products and offer customers the best online experience. The user's online experience begins from the simple and clear exposure of the products to order completion system.

The fields available on the "Payment Details" / "Checkout" page, where the user has to enter personal datasuch as: name, address, e-mail address, phone number and other information, should be as simple and structured as possible. Most of them to an online store's customers, I choose like delivery address of products to be the same with billing address. However, in WooCommerce it is checked by default option "Delivery to another address”/“Ship to different address". Which means that the user is forced to click or press once more on the phone screen to deactivate the additional fields, which are mandatory when the option is checked. Unwanted thing if we want to offer a better online experience to users.

Fortunately, the option "Ship to different address" from the Checkout page of Woocommerce can be unchecked by default by adding a line of code to the file functions.php of the current theme.

add_filter( 'woocommerce_ship_to_different_address_checked', '__return_false' );

Save the file after adding the line and go to the "checkout" page of the online store to check if the "Ship to different address" option is still checked by default.

Another field required by WooCommerce on the page "Payment details"But which is too unimportant in some countries, it is"Postal code”/“Billing Postcode". Many users have no idea what the postal code of the delivery address is, and courier companies do not follow this code. It is often misplaced by customers because the field is required.
It can be removed from all functions.php by adding the following lines:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
return $fields;
}

You now have an easier "order placement" system for your customers.

How to uncheck "Ship to different address" by default from the Checkout page of Woocommerce

About the author

Stealth

Passionate about everything gadget and IT, I write with pleasure on stealthsettings.com since 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.

Leave a Comment