• Resolved ariban99

    (@ariban99)


    i have a site and i was able to put the default country and state for the site on the checkout page but the below snippet
    however i will have a multisite and i was wondering how i can change the default state and country for each multisite that will be DOMAIN.com/XX

    /**
    * Change the default state and country on the checkout page
    */
    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 ‘US’; // country code
    }

    function change_default_checkout_state() {
    return ‘FL’; // state code
    }

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

    If the default country/state will the same across all sites in the network, you could turn that snippet into a simple plugin and then network activate it. That would cause it to affect all sites.

    If they are different, you could create separate plugins for each default you need. Then activate them on the appropriate sites instead of network activating them.

    Here’s a quick post on creating a simple plugin.

    https://www.wpbeaverbuilder.com/creating-wordpress-plugin-easier-think/

    Let me know if you have something else in mind.

    Cheers

    Thread Starter ariban99

    (@ariban99)

    nice i did not know its that easy to make a plugin, i will do that and then enable different plugins for different sites in my multi site

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘default country and state multisite woocommerce checkout’ is closed to new replies.