Import / Export columnsBrowser Info Environment
State, Zip, Country
When importing, the column order is
State, Country, Zip
So an export followed by an import results in country and zip data being cross-filled.
The example csv has the column order
State, Country, Zip
I will also amend this :)
At first, I created a store, no groups, exported and imported, CSV import gave a column mis-match error (expected 12 columns). Looking at the csv, there are only 11 columns.
Guessing this could be because there are no groups, I created some groups. Now when I edit my test store and save, I get a database error.
An exception occurred while executing 'INSERT INTO bthwstorelocation VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [null, "John Shop", "", "San Francisco", "CA", "United States", "94133", "37.8083823", "-122.41041970000003", "", "", "", "", "My test shop", "0", "0", ["1","2","3","4","5"]]: SQLSTATE: Invalid datetime format: 1366 Incorrect integer value: 'Array' for column 'gID' at row 1
Thinking maybe this was a table update glitch, I did a complete uninstall, dropped the tables, then reinstalled and repeated. Exactly the same problems.
Pushed an update that fixes that issue.
22 Concrete\Core\Database\Connection\Connection Execute
The db error happens when trying to add a store with groups through the dashboard page in order to create some content so I could export a CSV with groups.
Can you amend Line 296 in hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php
Similar error on edit from
Hacked 195 to
'gID' => null, //$_POST['hwGroups'],
seems to resolve that
will push an update to fix.
Once a store is geocoded, a change of address (ie correcting the country and zip) does not invalidate the geocode.
I will look into this and think of another way to update, may be a geo refresh button.
This should fix the cross over issue and other issues you have discovered,
After importing and adding to existing , I edited a loactaion and changed the zip.
An exception occurred while executing 'UPDATE bthwstorelocation SET name = ?, address = ?, city = ?, state = ?, country = ?, zip = ?, latitude = ?, longitude = ?, phone = ?, email = ?, url = ?, urltext = ?, extra = ?, storeimage = ?, markericon = ?, gID = ? WHERE sID = ?' with params ["John Store", "", "San Francisco", "CA", "United States", "94134", "", "", "", "", "", "", "test store", "0", "0", null, "3"]: SQLSTATE: Warning: 1265 Data truncated for column 'latitude' at row 1
Can you try this hack.
From line 173 add
and replace lines 197 and 198 with
'latitude' => $latitude, 'longitude' => $longitude,
Seems to accept null, which surprises me as my database settings usually object to null for numeric types. So I am not confident the below will be a good solution. Perhaps numeric 0 is safer.
The above could be simpler:
So if string failed I'm guessing floatval('0') may fix the issue?
However, with a lat/lng 0.0/0.0 value now in the database, will it be geocoded correctly? Ow will it get stuck off west africa? I haven't tested that far ahead.
I'm having a think of the best way to resolve this, I may alter the job to pick up blank and 0 and re geocode.
Not the best solution but works for now.
I will add a better indication on the store add/edit screen, probably with a map so you can visually see where it has geocoded to. Also have the option to refresh the location.