'Limit country to just on in dokan plugin

I am using dokan plugin and want to limit countries selection to just one in shipping page and setting page. I removed other countries from woocommerce i18n folder countries.php but nothing changes.



Solution 1:[1]

You can use the WooCommerce country filter to achieve this result.

add_filter( 'woocommerce_countries', 'rt_modify_country_list' );

function rt_modify_country_list( $countries ){

    $countries = array(
        'BD' => 'Bangladesh',
        'CN' => 'China' 
    );

    return $countries;
}

Thanks

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rafsun Chowdhury