Magento 2检查客户是否注册?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
$customer_check = $objectManager->get('Magento\Customer\Model\Customer');
$customer_check->setWebsiteId($website_id);
$customer_check->load('CUSTOMER_ID');

if ( $customer_check->getId() ) {
      // the customer already exist
} else {
      // does not exist
}

赞(1)
微信
支付宝
微信二维码图片

微信扫描二维码打赏

支付宝二维码图片

支付宝扫描二维码打赏

版权属于: sbboke版权所有。

转载时必须以链接形式注明作者和原始出处及本声明。

张贴在magento2教程标签:

相关文章

Please Login to comment