Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sbboke.com/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php:409) in /www/wwwroot/sbboke.com/wp-content/themes/pacify/content-single.php on line 5

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
}

版权属于: sbboke版权所有。

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

张贴在magento2教程标签:

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论