Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

Commit f2abf50

Browse files
authored
Merge pull request #28 from grayloon/add-columns-to-addresses
Add Street2, Company to Customer Addresses
2 parents 101f855 + b140709 commit f2abf50

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AddStreet2AndCompanyToMagentoCustomerAddresses extends Migration
8+
{
9+
public function up()
10+
{
11+
Schema::table('magento_customer_addresses', function (Blueprint $table) {
12+
$table->text('street2')->nullable()->after('street');
13+
$table->string('company')->nullable()->after('last_name');
14+
});
15+
}
16+
}

src/Support/MagentoCustomers.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ protected function syncCustomerAddresses($addresses, $customer)
8282
'region' => $address['region']['region'] ?? '',
8383
'region_id' => $address['region_id'] ?? 0,
8484
'street' => $address['street'][0] ?? '',
85+
'street2' => $address['street'][1] ?? null,
8586
'telephone' => $address['telephone'] ?? null,
8687
'postal_code' => $address['postcode'] ?? null,
8788
'city' => $address['city'] ?? null,
8889
'first_name' => $address['firstname'] ?? null,
8990
'last_name' => $address['lastname'] ?? null,
91+
'company' => $address['company'] ?? null,
92+
'default_shipping' => $address['default_shipping'] ?? false,
93+
'default_billing' => $address['default_billing'] ?? false,
9094
]);
9195
}
9296

0 commit comments

Comments
 (0)