Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $email = "jiro@example.com";
  2. $firstName = "Jiro";
  3. $lastName = "Ono";
  4.  
  5. $customer = $this->customerFactoryData->create();
  6.  
  7. $customer->setEmail($email);
  8. $customer->setFirstname($firstName);
  9. $customer->setLastname($lastName);
  10.  
  11. // Make sure we have a storeId to associate this customer with.
  12. $storeId = $this->storeManager->getStore()->getId();
  13. $customer->setStoreId($storeId);
  14.  
  15.  
  16. // Associate website_id with customer
  17. $websiteId = $this->storeManager->getStore($customer->getStoreId())->getWebsiteId();
  18. $customer->setWebsiteId($websiteId);
  19.  
  20. $this->accountManagement->createAccount($customer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement