I've a situation where clients ask me to calculate the distance between main address and customer address. And based on the distance I've to add some additional charge to my cart and some validation and showing customer that his address is out of service.
Below is description;
Main address; 2801 Florida Ave, Miami Fl, 33133.
If user's address entered is 25 miles or more from Main Address, a pop up will say "We are sorry. Your address falls outside of our service area and we are unable to deliver/pick up equipment to you at this time." If user's address is 5 miles away or less, no extra charge. If user's address is 5-10 miles away, $20 extra charge. If user's address is 10-25 mils away, $30 extra charge. Also any order that is $500 or more, no matter the distance (0-25 miles), no extra charge.
I've came up with below answer and thinking, is it the solution for my problem?
Distance from point A to B using Google Maps, PHP and MySQL
How can make sure for the correct addresses? Any alternate will be highly appreciated. Thanks