in Helper/MagentoDataHelper.php [403:436]
public function getUserDataFromOrder()
{
$order = $this->objectManager->get(\Magento\Checkout\Model\Session::class)->getLastRealOrder();
if (!$order) {
return null;
}
$userData = [];
$userData[AAMSettingsFields::EXTERNAL_ID] = $order->getCustomerId();
$userData[AAMSettingsFields::EMAIL] = $this->hashValue($order->getCustomerEmail());
$userData[AAMSettingsFields::FIRST_NAME] = $this->hashValue($order->getCustomerFirstname());
$userData[AAMSettingsFields::LAST_NAME] = $this->hashValue($order->getCustomerLastname());
$userData[AAMSettingsFields::DATE_OF_BIRTH] = $this->hashValue($order->getCustomerDob());
if ($order->getCustomerGender()) {
$genderId = $order->getCustomerGender();
$userData[AAMSettingsFields::GENDER] =
$this->hashValue(
$this->customerMetadata->getAttributeMetadata('gender')
->getOptions()[$genderId]->getLabel()
);
}
$billingAddress = $order->getBillingAddress();
if ($billingAddress) {
$userData[AAMSettingsFields::ZIP_CODE] = $this->hashValue($billingAddress->getPostcode());
$userData[AAMSettingsFields::CITY] = $this->hashValue($billingAddress->getCity());
$userData[AAMSettingsFields::PHONE] = $this->hashValue($billingAddress->getTelephone());
$userData[AAMSettingsFields::STATE] = $this->hashValue($billingAddress->getRegionCode());
$userData[AAMSettingsFields::COUNTRY] = $this->hashValue($billingAddress->getCountryId());
}
return array_filter($userData);
}