New answers tagged

0

When you redirect a customer who is logged in to the login form, Magento automatically redirects the customer to their dashboard. In your code, you need to log the customer out first; then you can redirect them to the login form. EDIT Sorry, I can't read sometimes. I think you're running into a caching problem. You don't write where you execute the code, but ...


0

You can write on breadcrumb.phtml page By Objectmanager like this : $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $request = $objectManager->get('\Magento\Framework\App\Request\Http'); $customerSession = $objectManager->get('Magento\Customer\Model\Session'); if(!$customerSession->isLoggedIn()) { if($request->...


0

From the login page , somehow your code reaches to this controller page (file: /vendor/magento/module-customer/Controller/Account/LoginPost.php), here you will see that message , then you can edit here or in your custom module. EditI checked your case , so in your case this file will be present in your custom module, override is given already by you , you ...


0

I suggest this solution which uses multiple fallbacks ... private $appContext; private $session; public function __construct( \Magento\Framework\App\Http\Context $appContext, \Magento\Customer\Model\Session $session ... ) { ... $this->appContext = $appContext; $this->session = $session; ... } public function isLoggedIn() { ...


Top 50 recent answers are included