In magento 2, zip code text box to search the store available or not - api

I am new to Magento.
I want a text box where i can type the zip code and if the store available in that location then i need to show the products of that particular store otherwise we need to show that "the store is not available in particular location".
The following is the example site. i want it as it is.
this site prompts for users zip location .after it will display stores of that particular.
Click on this link to see the working example
how do i do this . Do i need to install a module ?

Follow Some Steps:
You need an entity 'store' that is bound to a geo location.
You need to create a multi select attribute which values are located (using a
source model) with these stores. This way, you can attach a single product to
multiple stores (one to many relation)
Then you need some sort of external API to convert a postcode entered by the
customer to a geo location. I assume the Google Maps API can do this. It would
be best to handle this server side.
Then you need the math to calculate the distance between 2 geo locations in
your database query (probably enough to find on that subject on Google) and
filter your product collection on that.
Once you have the collection you have the power.
The external API will probably have a request threshold so you might have to
pay for that (depending on the traffic).
You need to determine the radius of maximum distance between 2 geo locations.
In a small country like the Netherlands stores could be a couple of km's apart
from each other, whilst in the United States it's not uncommon to have stores
tens or hundreds of km's from each other.
**Best Of Luck For Your Project**

Related

How can I determine the IANA timezone of a specific location

Is there a (free) webservice where I can a) give it an address (either full or city, state/province and zip), and b) get the IANA timezone of that address?
Use case: I have a form where a user manages clinics. Each clinic has an address. I want to preselect that IANA timezone of that address, so that I can adjust appointment date/times associated with that clinic.
I know that the Google Maps API and Bing Maps API can give me the lat/long of an address, and that there are other services that can give me the IANA TZ based on the lat/long. That said, those api's require subscriptions and keys and contracts, and it would also require a two request approach to get the single piece of data.
Address geolocation is a hard problem. It requires deep understanding of address systems and reacting to ever-changing, real-world, messy scenarios.
For example, you could get a database of the Zip codes of the United States and their approximate locations, but it would only be a snapshot. You'd find over time that new Zip codes would be added and missing from your data, and that existing Zip codes had been expanded to include other areas. You'd also find many Zip codes that are "non-locatable", such as those used to send mail to military overseas. You could even find a single Zip code that has addresses in two different time zones.
Take international concerns into effect and you'll find all sorts of edge cases. Every country and territory has their own special rules and situations.
It is a problem worth paying a service provider for. Trying to do geolocation in an offline manner might be possible, but it isn't advised.
The second part - figuring out which time zone goes to a location, is also messy. However it's slightly easier to coordinate. The Time Zone Boundary Builder is the main open-source project that attempts this. Most libraries referenced here use that data. But even then, it has updates and relies on borders established by Open Street Map data. Some of those borders are in dispute, so a service from Google, Microsoft, or others could give different results because they have map data with different borders. If you care about such things then you might want to test some edge cases against the different providers to see if you're satisfied with the results. You may find that the TZBB data works well, or you might prefer one of the online solutions.

Moqui / PopCommerce: country-specific postal address format profiles?

I'm totally new to Moqui/PopCommerce and my first impressions of it are great.
One thing that I didn't find how to do was country-specific postal address formatting: unfortunately, every country has a different address format, with different fields, ordering and arrangement of the fields.
For example, in most of Europe, the Zip code is expected left of the city name and there is no '#' sign in front of the house number. In France, the house number is left of the street and followed by a comma.
Some countries e.g. in Asia even have multiple address formats depending on other factors (e.g. rural vs city)
You can see explanations and examples here:
https://en.wikipedia.org/wiki/Address_(geography)#Format_by_country
http://www.columbia.edu/~fdc/postal/
So for any software that handles postal addresses, there are at least two situations where that country-specific address formatting is relevant:
1. in any output of a postal address (e.g. display, printout, mail, pdf, etc.)
2. in input of a postal address (e.g. address input form)
While an input form that doesn't adapt to the country-specific format is only a secondary problem (at least as long as it is only used by internal users and not external customers), any address output (especially one that is seen by any external customers) really HAS to conform to the country-specific address format and order, which means that there should be some way in the input form to choose an address format profile (e.g. by adapting to the chosen country).
I didn't see how to do that easily. I did find a PostalAddressSimpleTemplate variable in /vapps/system/Localization , but as I understand it, adding translations there would make the output dependent on the locale chosen by the user and not on the country of the address.
So my questions are:
* Is there any easy way to do this? (maybe I just didn't find it?)
* If not, is this something that would likely be added in the near future?
To date the functionality in SimpleScreens (which is where the postal address entry forms and display templates are located) is more USA oriented because all of the sponsorship for it has been by companies in the USA. There have been a few contributions that are localization related, and a few localization components that others have built (see the Add Ons page on moqui.org), but these particular forms seem to be customized rather than made more dynamic to work better across a wider variety of locales.
If you are targeting a specific locale the best thing to do is plugin your own address entry form and display template, and if you are building a public facing web site you probably shouldn't use the forms or templates from SimpleScreens anyway (all are meant for internal applications, or portal sorts of sites for external users with a limited scope, but really not for ecommerce and other sorts of sites where they are publicly available and users won't use them enough to be able to use them with no training or documentation, or from another point of view benefit from the standard UI patterns).
The OOTB input form has started to move in a more country-generic direction with the country drop-down being to the left of the state/province drop-down (for whatever sub-country region is used in the country) and the state/province drop-down reloads from the server when the country is changed.
The output structure (in the address .gstring file, for HTML output) doesn't currently do anything different based on the country.
These will both change over time, but right now basically to handle country-specific input forms or output templates customization is required.

Accessing locations in Objective-C

For my app I will need to access different town and store data for each town. Basically it will be a 2d array with one dimension being the town and the next the data. I was just wondering (using Xcode and Objective C) how I could access every town in a country (I'm looking at the UK if that helps). I don't need it on a map I just need it so people can store data relative to their town simply by searching for the town and adding their data to the array for that town. Thanks in advance!
There are a couple of ways to do it. If you want to use the user's device GPS to identify its location, than you can use the Google Places API that you can install through cocoapod
If you want to perform a search, you can obtain a API key from Google and then use their URL based search. For example, this URL should return a list of Starbuks in Seattle. There are more parameters that can be set and can apply to your case.
https://maps.googleapis.com/maps/api/place/textsearch/json?query=starbucks+seattle&sensor=false&key=YOUR_API_KEY

How to get a set of navteq links on a given road

I am using Nokia maps (Navteq, postgis DB).
Given a "link" I want to get all the "links" which belong to a bounding-box that map-match the same highway / route.
How can I do this using DB queries / Postgis?
Just came across this open topic. Do you know that HERE is meanwhile providing an online possibility for requesting linkIds within a boundingBox?
Further information can be sound here: Fleet Telematics Custom Locations
https://developer.here.com/documentation/custom-location/topics/key-concepts.html
And here is an example for a corridor search:
https://developer.here.com/documentation/custom-location/topics/example-search-corridor.html
That might be easier than host a database and then query the needed content.
Hope this helps.

limit address search by distance

I recently joined a team working on an application that maintains listings with addresses. The user searches, and includes their zipcode, and the application displays the distance to each listing. Currently we use the Google Maps API for this. Reading through questions here on StackOverflow seem to suggest that this is the best way of doing things:
php/mysql zip code proximity search
Search engine by distance
However, while reading through the API documentation, this seems to be expressly forbidden unless we also show a map for each result (and possibly also for each result we filter out, depending on how you read the following statement):
Use of the Distance Matrix API must relate to the display of information on a Google Map; for example, to determine origin-destination pairs that fall within a specific driving time from one another, before requesting and displaying those destinations on a map. Use of the service in an application that doesn't display a Google map is prohibited.
( https://developers.google.com/maps/documentation/distancematrix/ )
What's the best way to accomplish this without running afoul of any API terms?
do you consider the Geo::PostalCode module (perl)? It uses maxmind database to calculate distances between locations (and there is bind in different languages).