• Resolved cheonmu

    (@cheonmu)


    Hi,

    I want to set default checkout country as Japan.

    So, i added below code in my functions.php.

    
    add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' );
    
    function change_default_checkout_country() {
        return 'JP';
    }
     
    

    But its not working.

    Is that code still works with latest woocommerce?

    Or

    Is other way to set default checkout country?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    If your shop address is in Japan, you can select Shop base address for Default customer location under WooCommerce > Settings > General.

    If your shop location is not in Japan, that’s when you want to use the code you’ve posted. I’ve applied the code to my test site and it works properly.

    Link to image: https://snipboard.io/4HZyTr.jpg

    If it doesn’t for you, please make sure that No location by default is selected for Default customer location?

    Hi @cheonmu

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to set default checkout country?’ is closed to new replies.