Skip to main content
1 of 3

@Idham choudry,

you can add below code in to your observer to get customer information.

use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Model\Session;


$this->customerrepository = $customerrepository;
$this->customerSession = $customerSession;

$customerid = $this->customerSession->getCustomerId();
$customer = $this->customerrepository->getById($customerid);

$customer->getFirstName();