If want to develop a wordpress website like zomoto I want to know how to set user location detector on the website page so that user can get stores based on their selected place and after the store and food is selected it should show the delivery time of like with 45 min or 60 min from the restaurant to their place selected
Asked
Active
Viewed 125 times
0
-
You could directly use wordpress theme that handle that like https://themeforest.net/item/matur-food-delivery-ordering-wordpress-theme/21120158?s_rank=1. But it depends on all of your needs. – Alexis Vandepitte Feb 10 '18 at 15:13
-
Or this theme wich seems good : http://foodbakery.chimpgroup.com/ – Alexis Vandepitte Feb 10 '18 at 15:14
1 Answers
0
You can use getCurrentPosition()
method to get the user's position. For example:
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(userPosition);
} else {
alert("Geolocation is not supported by this browser.");
}
}
function userPosition(position) {
console.log(position)
}
Or using if you want to use php
please refer to Get user's current location in PHP

BlueSuiter
- 527
- 6
- 21