• Resolved calebelliot

    (@calebelliot)


    Is there a code snippet that I can use to default the shipping country to ‘US’ and state to ‘CA’ in Calculating Shipping Cost?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • xadapter

    (@xadapter)

    Hi Calebelliot,

    You can use the following snippet to fulfil this :
    *************************************************************
    add_filter( ‘default_checkout_billing_country’, ‘change_default_checkout_country’ );
    add_filter( ‘default_checkout_billing_state’, ‘change_default_checkout_state’ );

    function change_default_checkout_country() {
    return ‘XX’; // country code
    }

    function change_default_checkout_state() {
    return ‘XX’; // state code
    }
    ***********************************************
    Hope this works for you.

    Thread Starter calebelliot

    (@calebelliot)

    Thanks.

    xadapter

    (@xadapter)

    Your Welcome!

    If you liked our support, you can always drop in a review here

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set Default Country and State’ is closed to new replies.