eldan88 Posted May 25, 2012 Share Posted May 25, 2012 I have restaurant online ordering website based out of New York, NY. People who have been using the website to order online, are placing orders that are out side the restaurants delivery range. Any suggestions on how I can implement a validation on the checkout page, that validates the customer's address, which will match up with the restaurants delivery range. Are there any 3rd party apps that can handle this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/ Share on other sites More sharing options...
mrMarcus Posted May 25, 2012 Share Posted May 25, 2012 You could collect the range of zip codes that are within your delivery area and have a script that cross-references them when the user enters their address during checkout. Or you could work with a coordinates boundary system which would geocode the address and check to see if it's within your boundaries of delivery. Zip code is probably easiest IMO. However, being from Canada, I'm not sure how large an area a zip code in the US might cover. Our postal codes don't cover a very large area, not at least in my neck of the woods. Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348626 Share on other sites More sharing options...
ManiacDan Posted May 25, 2012 Share Posted May 25, 2012 there's a few ways to do this, maybe it would be easiest to simply hit the google maps API for driving directions. Any more than 20 minutes, and you're out of luck. Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348630 Share on other sites More sharing options...
mrMarcus Posted May 25, 2012 Share Posted May 25, 2012 there's a few ways to do this, maybe it would be easiest to simply hit the google maps API for driving directions. Any more than 20 minutes, and you're out of luck. That would work as well. The Directions API will return a 'duration' value which you could toss through a script that will approve/deny if drive time is > 20 (or whatever time you allow). Google Directions API Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348631 Share on other sites More sharing options...
Pikachu2000 Posted May 25, 2012 Share Posted May 25, 2012 He said he's in NYC, NY. 20 minutes driving distance would limit him to about a 11/2 block radius . . . Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348666 Share on other sites More sharing options...
ManiacDan Posted May 25, 2012 Share Posted May 25, 2012 He said he's in NYC So he did! Then it should be as easy as doing the house number math to see if it's within a few blocks (or whatever) Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348669 Share on other sites More sharing options...
eldan88 Posted May 26, 2012 Author Share Posted May 26, 2012 I have restaurant online ordering website based out of New York, NY. People who have been using the website to order online, are placing orders that are out side the restaurants delivery range. Any suggestions on how I can implement a validation on the checkout page, that validates the customer's address, which will match up with the restaurants delivery range. Are there any 3rd party apps that can handle this? Thanks Yes validation through zip codes is something I think we can implement with a fast turn around. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348693 Share on other sites More sharing options...
eldan88 Posted May 26, 2012 Author Share Posted May 26, 2012 there's a few ways to do this, maybe it would be easiest to simply hit the google maps API for driving directions. Any more than 20 minutes, and you're out of luck. Does its cost to use google maps API? Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348694 Share on other sites More sharing options...
ignace Posted May 26, 2012 Share Posted May 26, 2012 It's free up to 2500 directions and the results MUST be used to display a route on a map otherwise it's prohibited. https://developers.google.com/maps/documentation/directions/#Limits Quote Link to comment https://forums.phpfreaks.com/topic/263133-delivery-range-validation-for-food-online-ordering-website/#findComment-1348735 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.