In this post I am going to explain how to get list of all customers or you can say customer collection in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_customerFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Customer\Model\CustomerFactory $customerFactory, array $data = [] ) { $this->_customerFactory = $customerFactory; parent::__construct($context, $data);…


Recent Comments