Change the default U.S. state in the dropdown on WooCommerce checkout page

TIPS

Nov 23, 2020 | WooCommerce Tips | 0 comments

Add the following PHP code to your child theme functions.php file.
[php]
//default checkout US state dropdown blank instead of the default site state making taxes sometimes show up 
add_filter( 'default_checkout_billing_state', 'change_default_checkout_state' );
add_filter( 'default_checkout_shipping_state', 'change_default_checkout_state' );
function change_default_checkout_state() {
    return ''; //set state code if you want to set it otherwise leave it blank.
}
[/php]

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

More Tips

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields