|
|
@@ -188,7 +188,15 @@ for($i = 0; $data = fgetcsv($handle); $i++) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(empty($internal_id)) continue;
|
|
|
+ if(empty($internal_id)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isset($address_2) && !isset($city)) {
|
|
|
+ $city = $address_2;
|
|
|
+ $address_2 = null;
|
|
|
+ }
|
|
|
+
|
|
|
if(empty($city) && empty($postal_code)) {
|
|
|
echo sprintf("Skipping row %d as there is no city or postal code\n", $row_number);
|
|
|
continue;
|
|
|
@@ -202,7 +210,7 @@ for($i = 0; $data = fgetcsv($handle); $i++) {
|
|
|
]);
|
|
|
|
|
|
if(!$location) {
|
|
|
- $location = new Location;
|
|
|
+ $location = new Location();
|
|
|
$location->customer_id = $customer_id;
|
|
|
$location->internal_id = $internal_id;
|
|
|
}
|