Toggle Nav
My Cart 0

Google Distance Provider in Magento

Google Distance Provider in Magento

Google Distance Provider in Magento

The Distance Priority Algorithm determines the closest source to fulfil shipments by comparing the location of the shipping destination address with source locations. Physical distance or time spent going between locations can be used to calculate the distance, as can database information or driving, walking, or bicycle directions. Use this source selection algorithm to suggest the source most near to shipping destination addresses.

Configuration of Google Distance Provider in Adobe Commerce

Configure Google Maps 

To configure Google Distance Provider in Magento, you don't require a Google account. Instead, the procedure includes, if needed, the setup of a Google account and a project. Then, a billing account and payment method must be added to your Google account to finish configurations and use the algorithm for this option.

The distance matrix API and geocoding API, both of which should be enabled, are the main components of the Google Maps Platform. See Configuring Distance Priority Algorithm for more information.

Configure the Google MAP Distance Provider

  • Step 1: Select Stores > Settings > Configuration from the Admin sidebar.
  • Step 2: Select Inventory from the left panel's expanded Catalog option.
  • Step 3: In the Distance Provider for Distance Based SSA section, change Provider to Google MAP.
  • Step 4: Open up the Google Distance Provider area, then adjust the settings as follows:
  • Step 5: Enter the key you copied from your Google Account as the Google API Key.
  • Step 6: Choose a configuration for the computation mode.
    1. Driving: (Default) Invokes the road network to get the most common driving directions.
    2. Walking: Using sidewalks and pedestrian pathways, ask for directions to stroll (where available).
    3. Bicycling: Asks for bicycle instructions utilizing bicycle lanes and the recommended streets (where available). Only select cities in the US and Canada now provide the Distance Matrix Service.
  • Step 7: Choose a value type for Value:
    1. Distance: (Default) Provides the distance between two points in either imperial or metric units (kilometers and meters) (miles and feet).
    2. Time to Destination: Returns the amount of time, in hours and minutes, needed to travel from the source locations to the shipment address.
  • Step 8: After finishing, click Save Config

Configure offline calculation 

The distance between the shipping destination and the source addresses is calculated offline using country codes. It might be necessary to work with developers to configure this option. To download and import data from geonames.org, you will perform an Inventory Management CLI command.

  • Step 1: Select Stores > Settings > Configuration from the Admin sidebar.
  • Step 2: Select Inventory from the left panel's expanded Catalog option.
  • Step 3: Extend the section titled "Distance Provider for Distance Based SSA."
  • Step 4: Set Provider to Offline Calculation and uncheck the Use system value box.
  • Step 5: After finishing, click Save Config.
January 5, 2023
Did you like this post?
0
0