我是新的magento开发的移动应用程序。我必须为登录写API代码。此应用程序登录没有密码,并通过手机otp验证登录。在我的编码过程中,我可以通过电子邮件访问客户id。
$customer = $this->customerFactory->create();
$customer->loadByEmail($email);
$customerId = $customer->getId();但是我需要通过电话号码来访问这个客户id,而不是这个。“loadbyphone”的代码是什么?
发布于 2022-06-09 05:39:01
我们可以按照这样做。但要确保电话号码是唯一的。
$customer = $this->customerFactory->create();
$customer->load($telephone_number,'telephone_number');
$customer->getData();https://stackoverflow.com/questions/72530853
复制相似问题