Create di.xml and add the below code
Magemonkey/Redirect/etc/frontend/di.xml
1 2 3 4 5 6 |
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="\Magento\Customer\Controller\Account\LoginPost"> <plugin name="redirect_custom_url" type="Magemonkey\Redirect\Plugin\RedirectCustomUrl" sortOrder="1" /> </type> </config> |
Create the plugin
Magemonkey/Redirect/Plugin/RedirectCustomUrl.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<?php namespace Magemonkey\Redirect\Plugin; class RedirectCustomUrl { public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\App\Http\Context $authContext, \Magento\Framework\App\Response\RedirectInterface $redirect, \Magento\Framework\App\RequestInterface $request ){ $this->storeManager = $storeManager; $this->authContext = $authContext; $this->redirect = $redirect; $this->_request = $request; } public function afterExecute(\Magento\Customer\Controller\Account\LoginPost $subject,$result) { $currentWebsiteId = $this->storeManager->getStore()->getWebsiteId(); $isLoggedIn = $this->authContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH); if ($isLoggedIn){ $customUrl = 'customurl.html'; $result->setPath($customUrl); } return $result; } } |
If you are facing error as per the below, Then...
I've to add custom CSS for particular store on checkout...
If we use the quote collectTotal() method in our custom...
If you want to set a different look for a...
I have recently faced an issue during CSV import as...