Uncaught Error: Call to a member function dispatch() on null

created at 07-05-2021 views: 24

The main problem is that because the class of the constructor does not inherit the parent class, the constructor needs to be updated as follows:

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Customer\Model\Session $customerSession,  
    \Magento\Framework\ObjectManagerInterface $objectManager,
    array $data = []
 ) {
    parent::__construct($context, $data);
    $this->customerSession = $customerSession;
    $this->_objectManager = $objectManager;
  }
created at:07-05-2021
edited at: 07-05-2021: