new EqualsFilter('customer.boundSalesChannelId',
$source->
getSalesChannelId()),
]));
/** @var CustomerEntity|null $customer */
$customer =
$this->customerRepository->
search($criteria,
$context)->
get($customerId);
if (!
$customer) { return null;
} $activeBillingAddressId =
$options[SalesChannelContextService::BILLING_ADDRESS_ID
] ??
$customer->
getDefaultBillingAddressId();
$activeShippingAddressId =
$options[SalesChannelContextService::SHIPPING_ADDRESS_ID
] ??
$customer->
getDefaultShippingAddressId();
$addressIds[] =
$activeBillingAddressId;
$addressIds[] =
$activeShippingAddressId;
$addressIds[] =
$customer->
getDefaultBillingAddressId();
$addressIds[] =
$customer->
getDefaultShippingAddressId();
$criteria =
new Criteria(\
array_unique($addressIds));
$criteria->
setTitle('context-factory::addresses'
);
$criteria->
addAssociation('salutation'
);
$criteria->
addAssociation('country'
);
$criteria->
addAssociation('countryState'
);