Skip to content

Commit

Permalink
When no firstName or lastName present, don't use first and last from …
Browse files Browse the repository at this point in the history
…full instead use first, and implode the rest so that we don't miss any names in the middle
  • Loading branch information
iesus committed Nov 30, 2018
1 parent 42b741a commit 5b01327
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ protected function _addAddressToQuote($quote, $data)
$customer = new Varien_Object($data->getData('Customer'));

$fakeFull = explode(' ', $billingAddress->getData('FullName'));
$fakeFirst = (end($fakeFull)) ? end($fakeFull) : $notNull;
$fakeLast = (isset($fakeFull[0])) ? $fakeFull[0] : $notNull;
if (isset($fakeFull[0])) { unset($fakeFull[0]); }
$fakeFirst = (end($fakeFull)) ? implode(' ', $fakeFull) : $notNull;

$fakeFullShipping = explode(' ', $shippingAddress->getData('FullName'));
$fakeFirstShipping = (end($fakeFull)) ? end($fakeFull) : $notNull;
$fakeLastShipping = (isset($fakeFull[0])) ? $fakeFull[0] : $notNull;

$fakeLastShipping = (isset($fakeFullShipping[0])) ? $fakeFullShipping[0] : $notNull;
if (isset($fakeFullShipping[0])) { unset($fakeFullShipping[0]); }
$fakeFirstShipping = (end($fakeFullShipping)) ? implode(' ', $fakeFullShipping) : $notNull;

$reference = ($data->getData('CustomerReference'))
? ($data->getData('CustomerReference'))
Expand Down

0 comments on commit 5b01327

Please sign in to comment.