Magento 2 Dealer Locator CLI Commands
Looking for Dealer Locator? View the full Dealer Locator page to explore features, configuration options, and pricing.
The Dealer Locator has two command line tools for jobs that are too big or too slow for the admin: importing a large dealer file and looking up map coordinates for many dealers at once. This page explains what each command does, its options, and when you'd use it instead of the admin. You run them on the server from your Magento root, usually as part of a first import or after switching map provider. Neither command needs to be scheduled; both are for running by hand when you need them. You'll need command line access to your server, or a developer or hosting party who has it.
dealerlocator:import
Imports dealers from a CSV file: the same import as Content → Dealer Locator → Dealers → Import CSV, with the same columns and rules (see the import guide), but without the 10 MB limit and without the 60-second limit on looking up coordinates.
bin/magento dealerlocator:import var/import/dealers.csv
Options:
| Option | What it does |
|---|---|
--dry-run |
Checks the file and shows what would happen, without saving anything |
--no-geocode |
Doesn't look up missing coordinates (fast); locate the dealers later with dealerlocator:geocode |
--no-create-categories |
Reports unknown product categories as errors instead of creating them |
-v |
Shows the result of each row while the import runs |
Example output:
Row 4 (D-1003): Country "ZZ" is not a known two-letter country code (ISO 3166-1), such as NL, BE or DE.
Done: 120 created, 4 updated, 0 unchanged, 1 failed.
Product categories created: Tents, Backpacks
Coordinates looked up: 118. Dealers without coordinates: 2.
The command ends with exit code 1 when a row failed, so a script can tell that something needs attention.
When to use:
- The first import of a large dealer list, especially with OpenStreetMap: at one lookup per second, 1,000 dealers take about 17 minutes. Add
-vto follow the progress. - Regular imports from another system, run by your own script.
dealerlocator:geocode
Looks up coordinates for all dealers that don't have them yet, so they appear on the map. Dealers that already have coordinates are left alone.
bin/magento dealerlocator:geocode
Options:
| Option | What it does |
|---|---|
--limit=N |
Processes at most N dealers, e.g. to try it on a few first |
Example output:
D-1001: 52.0909342, 5.1210464
D-1007: The address "Domstraat 99, 9999 ZZ Utrecht" was not found. Check it, or enter the coordinates by hand.
Done: 1 located, 1 not located, 0 failed to save.
When to use:
- After an import with
--no-geocode, or an admin import that stopped looking up coordinates after 60 seconds - After correcting addresses of dealers that weren't on the map
Tip: Dealers that still aren't found after this need a closer look: filter the dealer grid on On Map: No and check their addresses, or enter their coordinates by hand.
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team
For a complete overview of features and configuration options, see Dealer Locator.