Hello @aizensoft ,
Dokan uses WooCommrce’s country list so you can remove a specific country using this code –
function woo_allow_specific_country( $country ) {
unset($country['BD']);
return $country;
}
add_filter( 'woocommerce_countries', 'woo_allow_specific_country', 10, 1 );
Here we can use another trick to remove all countries and allow only selected one by modifying the country array –
function woo_allow_specific_country( $country ) {
unset($country);
$country = array(
'BD' => __( 'Bangladesh', 'woocommerce' ),
);
return $country;
}
add_filter( 'woocommerce_countries', 'woo_allow_specific_country', 10, 1 );
You can use conditions and use this for specific page/user roles also.
I hope this helps.
Thank you.