Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $email = "jiro@example.com";
- $firstName = "Jiro";
- $lastName = "Ono";
- $customer = $this->customerFactoryData->create();
- $customer->setEmail($email);
- $customer->setFirstname($firstName);
- $customer->setLastname($lastName);
- // Make sure we have a storeId to associate this customer with.
- $storeId = $this->storeManager->getStore()->getId();
- $customer->setStoreId($storeId);
- // Associate website_id with customer
- $websiteId = $this->storeManager->getStore($customer->getStoreId())->getWebsiteId();
- $customer->setWebsiteId($websiteId);
- $this->accountManagement->createAccount($customer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement