'How to get address of all vendors from same city in Dokan Plugin?

I am using dokan for my client's website. they want to show map locations of all the vendors if they are in the same city. For example, if you select London then it should show a map of London, and makers should be there on google map. I have done with the map part. I want to get the addresses of all vendors which are there in London. How to do this?



Solution 1:[1]

we can get the addresses of the sellers by using the below code.

function test_users(){
 $sellers = dokan_get_sellers();    
 foreach ($sellers['users'] as $seller) {
 $store_info = dokan_get_store_info($seller->ID);
 echo "<br>";
echo $store_info['address']['street_1'].' '.$store_info['address']['street_2'].' 
   '.$store_info['address']['city'].' '.$store_info['address']['zip'];
    }
}
add_shortcode('test','test_users');

You can use this shortcode[test] to show the addresses.

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