Import Dealers with CSV | Magento 2 Dealer Locator
Looking for Dealer Locator? View the full Dealer Locator page to explore features, configuration options, and pricing.
With the CSV import of the Dealer Locator you add or update hundreds of dealers in one go, straight from a spreadsheet. This guide walks through preparing the file in Excel or Google Sheets, every column the import understands, the options on the import page, and how to read the report afterwards. It also explains how re-importing works, so you can keep your dealer list in a spreadsheet and simply upload it again after changes, and what to expect when the module looks up map coordinates for many addresses at once. A sample file is available in the admin to start from.
Where to Find It
Navigate to: Content → Dealer Locator → Dealers → Import CSV
The Download Sample CSV button (on the dealer grid and the import page) gives you a ready-made example to start from.
How the Import Works
- Every row is one dealer. Dealers are matched on code: an existing code is updated, a new code creates a dealer.
- Rows are handled one by one. A row with a problem is reported and skipped; the other rows are still imported.
- Columns that are not in the file are left as they are for existing dealers. A file with only
code,name,country,phoneupdates just the phone numbers. - An empty cell clears the value, for example an empty phone cell removes the phone number.
- Rows that don't change anything are counted as "Unchanged" and not saved again.
Preparing the File
- The first row contains the column names. Their order doesn't matter.
- Comma, semicolon or tab separated: the import detects it.
- Saved from Excel? Both "CSV UTF-8" and Excel's regular "CSV" work, so accented characters like "é" or "ü" come through correctly.
- Values that contain the separator, such as several categories, go between double quotes:
"Tents, Backpacks". Excel and Google Sheets do this for you. - Maximum 10 MB per file in the admin. For bigger files, use the command line (see the CLI commands guide).
Columns
| Column | Required | What to fill in |
|---|---|---|
code |
Yes | Unique reference for the dealer. Letters, digits, "-", "_" and "." only, max. 64 characters. |
name |
Yes | Dealer name as shown to visitors. |
country |
Yes | Two-letter country code: NL, BE, DE, FR, GB... |
street |
Street and house number, e.g. Domplein 9. |
|
postcode |
Postcode. | |
city |
City. A postcode or city is needed to place the dealer on the map. | |
phone |
Phone number as you want to show it. | |
website |
Full address including https://. |
|
categories |
Product category names, separated by commas (or a vertical bar): "Tents, Backpacks". |
|
stores |
Store view codes, separated by commas: "nl, be_nl". Empty or all means all store views. |
|
active |
1 or 0. yes/no, true/false and ja/nee also work. Empty means active. |
|
latitude, longitude |
Coordinates, if you have them. Use both or neither. |
Column names are not case-sensitive, and a few common alternatives are recognised: zip or postal_code for postcode, country_code for country, lat and lng for the coordinates, is_active for active, telephone for phone. Other columns are ignored and mentioned in the report as a notice.
Product Categories
Categories are matched on their default label, regardless of upper or lower case. With Create product categories that don't exist yet switched on, unknown names are created automatically, each only once. Switch it off when you want typing errors to be reported instead of turning into new categories.
Coordinates
- Coordinates in the file are used as they are.
- When they're empty, existing dealers keep their coordinates, so re-importing doesn't look up every address again.
- Dealers without coordinates, and dealers whose address changed, get their coordinates looked up (when that option is on).
Options on the Import Page
- Look up missing coordinates from the address - on by default. Switch it off to import quickly and locate the dealers afterwards.
- Create product categories that don't exist yet - see above.
- Validate only, don't save anything - checks the whole file and shows what would happen, without saving. Recommended for the first import of a new file.
Large Files and Looking Up Coordinates
With OpenStreetMap the module can look up about one address per second (their usage policy). An admin page can't wait for hundreds of lookups, so in the admin the lookups stop after 60 seconds: the remaining dealers are imported without coordinates, and the report tells you so. Then either:
- filter the dealer grid on On Map: No, select the dealers and use Find Location (again 60 seconds per run), or
- run
bin/magento dealerlocator:geocodeon the server, which has no time limit.
With Google Maps lookups are much faster, so the limit is rarely reached.
The Report
After the import, the page shows:
- Created, Updated, Unchanged, Failed - the number of rows per result
- Product categories created
- Coordinates looked up and Dealers without coordinates
- A list of messages per row, with the row number and dealer code:
- Error - the row was not imported, for example "Country "XX" is not a known two-letter country code" or "Code "D-12" is also used in row 4"
- Warning - the dealer was imported, but its address wasn't found on the map
- Notice - for information, such as a column that isn't used
Row numbers match the rows in your spreadsheet: row 1 is the header.
Example
code,name,street,postcode,city,country,phone,website,categories,stores,active,latitude,longitude
D-1001,Outdoor Centre Utrecht,Domplein 9,3512 JE,Utrecht,NL,+31 30 000 0001,https://www.example.com,"Tents, Backpacks",all,1,,
D-1003,Adventure Store Brussels,Grote Markt 1,1000,Brussel,BE,,,"Backpacks, Sleeping bags",all,1,50.8467,4.3525
The first dealer gets its coordinates looked up; the second uses the ones in the file.
Updating only the active status of two dealers:
code,name,country,active
D-1001,Outdoor Centre Utrecht,NL,0
D-1003,Adventure Store Brussels,BE,1
name and country are required in every file, so include them even when they don't change.
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.