magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
337 stars 248 forks source link

Stores do not show up when searching for city/postcode. [In-Store Pickup] #3184

Open Uncover-Commerce opened 4 years ago

Uncover-Commerce commented 4 years ago

Preconditions (*)

  1. Magento ver. 2.4.0

Steps to reproduce (*)

  1. Make sure in-store pickup locations have been added
  2. Add product(s) to cart and proceed to checkout
  3. Select in-store pickup delivery method
  4. Enter a postcode or city

Note: This was also tested using the /swagger page

Expected result (*)

  1. A list of locations within the set radius of the given city or postcode

Actual result (*)

  1. No results Please note: If I delete the text inside the input, all of the locations show

Originally posted https://github.com/magento/devdocs/issues/7847#issuecomment-690421088

@swnsma @keharper

m2-assistant[bot] commented 4 years ago

Hi @Spectre-Creative. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


swnsma commented 4 years ago

Hi @Spectre-Creative! Thank you for your report!

Could you please clarify:

  1. Which algorithm is used for distance search? (Bo -> Stores -> Config -> Catalog -> Inventory -> Distance Provider for Distance Based SSA -> Provider)
  2. If you are using Google Map, is there correct API Key in place?
  3. If you are using Offline calculation, have you imported geonames with command inventory-geonames:import? (more info here)

Offline calculation is very inaccurate and we are not recommending to use it in production.

Uncover-Commerce commented 4 years ago

Thanks for getting back to us @swnsma - Sorry for the delay. Using the Google API, which has helped us narrow this down as the Google Console is showing the 4xx errors for every attempt. But they do not show the error messages.

The console.log on the Magento site front-end does not show the Google API error response message either. Is there a log file these error responses get placed? I tried looking in the usual var/log/ folder and went through some files but could not find any errors sent by Google.

Thanks

Uncover-Commerce commented 4 years ago

Well we managed to get the response from Google's API showing using the "vendor/magento/module-inventory-distance-based-source-selection/Model/DistanceProvider/GoogleMap/GetGeoCodesForAddress.php" file and outputting after line 94.

But the same problem exists. All stores show when we begin typing in the input and then delete all characters. But when searching for city/post-code, no stores are showing.

swnsma commented 4 years ago

Hi @Spectre-Creative! Sorry for delay.

The reason why you can see a full list of the Stores is because we are showing all available stores if nothing found near customer address or customer is a guest. May I ask you to check latitude/longitude values in your Pickup Locations (Sources)? If you have not received a valid response from Google's API, maybe latitude/longitude did not save in your Pickup Locations.

Uncover-Commerce commented 4 years ago

The last piece of the puzzle was indeed the latitude/longitudes either had wrong values or empty. Thank you so much for responding to help out. Much appreciated 👍