after customer registration need to redirect custom page in magento 2 Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento Custom Register Page - Redirect IssueAfter login it redirect to previous page but it's not logged inCustomer login redirect to homepageRedirect Registered Customer issueMagento 2 after customer login redirect to my orders failed to set login_redirect sessionRedirect to login page after registration in Magento 2Magento 2- Redirect customer to home page after customer session expires instead login page?Magento 2 : Redirect on cart page after loginHow to redirect the url to custom path from magento2 customer confirm emailMagento 1: after login need to redirect to previous page (before login) instead of dashboard page
How should I respond to a player wanting to catch a sword between their hands?
Training a classifier when some of the features are unknown
How can I make names more distinctive without making them longer?
What are the performance impacts of 'functional' Rust?
Antler Helmet: Can it work?
I'm having difficulty getting my players to do stuff in a sandbox campaign
Is it possible to boil a liquid by just mixing many immiscible liquids together?
Are my PIs rude or am I just being too sensitive?
How to rotate it perfectly?
Why is there no army of Iron-Mans in the MCU?
How to say 'striped' in Latin
Slither Like a Snake
Stars Make Stars
Why use gamma over alpha radiation?
How does modal jazz use chord progressions?
Simulating Exploding Dice
Replacing HDD with SSD; what about non-APFS/APFS?
How to say that you spent the night with someone, you were only sleeping and nothing else?
Strange behaviour of Check
How do I keep my slimes from escaping their pens?
Who can trigger ship-wide alerts in Star Trek?
How do you clear the ApexPages.getMessages() collection in a test?
Why does this iterative way of solving of equation work?
Determine whether f is a function, an injection, a surjection
after customer registration need to redirect custom page in magento 2
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento Custom Register Page - Redirect IssueAfter login it redirect to previous page but it's not logged inCustomer login redirect to homepageRedirect Registered Customer issueMagento 2 after customer login redirect to my orders failed to set login_redirect sessionRedirect to login page after registration in Magento 2Magento 2- Redirect customer to home page after customer session expires instead login page?Magento 2 : Redirect on cart page after loginHow to redirect the url to custom path from magento2 customer confirm emailMagento 1: after login need to redirect to previous page (before login) instead of dashboard page
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
here customerregistersuceessobserver.php
$loginUrl = $this->_objectManager->create(
'MagentoFrameworkUrlInterface'
)->getUrl("marketplace/account/login");
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setBeforeAuthUrl($loginUrl);
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setAfterAuthUrl($loginUrl);
here i need to redirect the customer after register in magento 2
how i can set redirect (note :email verfication enabled)
how i can do this
now it redirects to customer login page
magento2 customer event-observer redirect
add a comment |
here customerregistersuceessobserver.php
$loginUrl = $this->_objectManager->create(
'MagentoFrameworkUrlInterface'
)->getUrl("marketplace/account/login");
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setBeforeAuthUrl($loginUrl);
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setAfterAuthUrl($loginUrl);
here i need to redirect the customer after register in magento 2
how i can set redirect (note :email verfication enabled)
how i can do this
now it redirects to customer login page
magento2 customer event-observer redirect
add a comment |
here customerregistersuceessobserver.php
$loginUrl = $this->_objectManager->create(
'MagentoFrameworkUrlInterface'
)->getUrl("marketplace/account/login");
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setBeforeAuthUrl($loginUrl);
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setAfterAuthUrl($loginUrl);
here i need to redirect the customer after register in magento 2
how i can set redirect (note :email verfication enabled)
how i can do this
now it redirects to customer login page
magento2 customer event-observer redirect
here customerregistersuceessobserver.php
$loginUrl = $this->_objectManager->create(
'MagentoFrameworkUrlInterface'
)->getUrl("marketplace/account/login");
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setBeforeAuthUrl($loginUrl);
$this->_objectManager->create(
'MagentoCustomerModelSession'
)->setAfterAuthUrl($loginUrl);
here i need to redirect the customer after register in magento 2
how i can set redirect (note :email verfication enabled)
how i can do this
now it redirects to customer login page
magento2 customer event-observer redirect
magento2 customer event-observer redirect
asked 12 mins ago
prabhakaran7prabhakaran7
28812
28812
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
di.xml :
<?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="MagentoCustomerModelAccountRedirect">
<plugin name="NewAcctRedirectPlug" type="VendorModulePluginRedirect" disabled="false" sortOrder="1"/>
</type>
</config>
events.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_register_success">
<observer name="custom_redirect_register_success" instance="VendorModuleObserverRegister" disabled="false"/>
</event>
</config>
Register.php:
<?php
namespace VendorModuleObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkRegistry;
class Register implements ObserverInterface
protected $coreRegistry;
public function __construct(Registry $registry)
$this->coreRegistry = $registry;
public function execute(MagentoFrameworkEventObserver $observer)
$this->coreRegistry->register('is_new_account', true);
VendorModulePluginRedirect.php:
<?php
namespace VendorModulePlugin;
use MagentoFrameworkControllerResultFactory;
use MagentoFrameworkRegistry;
use MagentoFrameworkUrlInterface;
class Redirect
protected $coreRegistry;
protected $url;
protected $resultFactory;
public function __construct(Registry $registry, UrlInterface $url, ResultFactory $resultFactory)
$this->coreRegistry = $registry;
$this->url = $url;
$this->resultFactory = $resultFactory;
public function aroundGetRedirect ($subject, Closure $proceed)
if ($this->coreRegistry->registry('is_new_account'))
/** @var MagentoFrameworkControllerResultRedirect $result */
$result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$result->setUrl($this->url->getUrl('custom/path'));
return $result;
return $proceed();
add a comment |
Try this,
Add the below code to observer, and event must be
customer_register_success
<?php
namespace VendorModuleNameObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkExceptionInputException;
class LoginSuccess implements ObserverInterface
protected $_urlInterface;
protected $_response;
public function __construct(
MagentoCustomerModelSession $customerSession,
MagentoFrameworkUrlInterface $urlInterface,
MagentoFrameworkAppResponseFactory $response
)
$this->_urlInterface = $urlInterface;
$this->_response = $response;
$this->customerSession = $customerSession;
public function execute(MagentoFrameworkEventObserver $observer)
if ($this->customerSession->isLoggedIn())
$redirectUrl = $this->_urlInterface->getUrl('custom_routename/controller');
$this->_response->create()
->setRedirect($redirectUrl)
->sendResponse();
exit(0);
return $this;
Hope this helps.
it will work for after customer registration
– prabhakaran7
3 mins ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270058%2fafter-customer-registration-need-to-redirect-custom-page-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
di.xml :
<?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="MagentoCustomerModelAccountRedirect">
<plugin name="NewAcctRedirectPlug" type="VendorModulePluginRedirect" disabled="false" sortOrder="1"/>
</type>
</config>
events.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_register_success">
<observer name="custom_redirect_register_success" instance="VendorModuleObserverRegister" disabled="false"/>
</event>
</config>
Register.php:
<?php
namespace VendorModuleObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkRegistry;
class Register implements ObserverInterface
protected $coreRegistry;
public function __construct(Registry $registry)
$this->coreRegistry = $registry;
public function execute(MagentoFrameworkEventObserver $observer)
$this->coreRegistry->register('is_new_account', true);
VendorModulePluginRedirect.php:
<?php
namespace VendorModulePlugin;
use MagentoFrameworkControllerResultFactory;
use MagentoFrameworkRegistry;
use MagentoFrameworkUrlInterface;
class Redirect
protected $coreRegistry;
protected $url;
protected $resultFactory;
public function __construct(Registry $registry, UrlInterface $url, ResultFactory $resultFactory)
$this->coreRegistry = $registry;
$this->url = $url;
$this->resultFactory = $resultFactory;
public function aroundGetRedirect ($subject, Closure $proceed)
if ($this->coreRegistry->registry('is_new_account'))
/** @var MagentoFrameworkControllerResultRedirect $result */
$result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$result->setUrl($this->url->getUrl('custom/path'));
return $result;
return $proceed();
add a comment |
di.xml :
<?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="MagentoCustomerModelAccountRedirect">
<plugin name="NewAcctRedirectPlug" type="VendorModulePluginRedirect" disabled="false" sortOrder="1"/>
</type>
</config>
events.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_register_success">
<observer name="custom_redirect_register_success" instance="VendorModuleObserverRegister" disabled="false"/>
</event>
</config>
Register.php:
<?php
namespace VendorModuleObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkRegistry;
class Register implements ObserverInterface
protected $coreRegistry;
public function __construct(Registry $registry)
$this->coreRegistry = $registry;
public function execute(MagentoFrameworkEventObserver $observer)
$this->coreRegistry->register('is_new_account', true);
VendorModulePluginRedirect.php:
<?php
namespace VendorModulePlugin;
use MagentoFrameworkControllerResultFactory;
use MagentoFrameworkRegistry;
use MagentoFrameworkUrlInterface;
class Redirect
protected $coreRegistry;
protected $url;
protected $resultFactory;
public function __construct(Registry $registry, UrlInterface $url, ResultFactory $resultFactory)
$this->coreRegistry = $registry;
$this->url = $url;
$this->resultFactory = $resultFactory;
public function aroundGetRedirect ($subject, Closure $proceed)
if ($this->coreRegistry->registry('is_new_account'))
/** @var MagentoFrameworkControllerResultRedirect $result */
$result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$result->setUrl($this->url->getUrl('custom/path'));
return $result;
return $proceed();
add a comment |
di.xml :
<?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="MagentoCustomerModelAccountRedirect">
<plugin name="NewAcctRedirectPlug" type="VendorModulePluginRedirect" disabled="false" sortOrder="1"/>
</type>
</config>
events.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_register_success">
<observer name="custom_redirect_register_success" instance="VendorModuleObserverRegister" disabled="false"/>
</event>
</config>
Register.php:
<?php
namespace VendorModuleObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkRegistry;
class Register implements ObserverInterface
protected $coreRegistry;
public function __construct(Registry $registry)
$this->coreRegistry = $registry;
public function execute(MagentoFrameworkEventObserver $observer)
$this->coreRegistry->register('is_new_account', true);
VendorModulePluginRedirect.php:
<?php
namespace VendorModulePlugin;
use MagentoFrameworkControllerResultFactory;
use MagentoFrameworkRegistry;
use MagentoFrameworkUrlInterface;
class Redirect
protected $coreRegistry;
protected $url;
protected $resultFactory;
public function __construct(Registry $registry, UrlInterface $url, ResultFactory $resultFactory)
$this->coreRegistry = $registry;
$this->url = $url;
$this->resultFactory = $resultFactory;
public function aroundGetRedirect ($subject, Closure $proceed)
if ($this->coreRegistry->registry('is_new_account'))
/** @var MagentoFrameworkControllerResultRedirect $result */
$result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$result->setUrl($this->url->getUrl('custom/path'));
return $result;
return $proceed();
di.xml :
<?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="MagentoCustomerModelAccountRedirect">
<plugin name="NewAcctRedirectPlug" type="VendorModulePluginRedirect" disabled="false" sortOrder="1"/>
</type>
</config>
events.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="customer_register_success">
<observer name="custom_redirect_register_success" instance="VendorModuleObserverRegister" disabled="false"/>
</event>
</config>
Register.php:
<?php
namespace VendorModuleObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkRegistry;
class Register implements ObserverInterface
protected $coreRegistry;
public function __construct(Registry $registry)
$this->coreRegistry = $registry;
public function execute(MagentoFrameworkEventObserver $observer)
$this->coreRegistry->register('is_new_account', true);
VendorModulePluginRedirect.php:
<?php
namespace VendorModulePlugin;
use MagentoFrameworkControllerResultFactory;
use MagentoFrameworkRegistry;
use MagentoFrameworkUrlInterface;
class Redirect
protected $coreRegistry;
protected $url;
protected $resultFactory;
public function __construct(Registry $registry, UrlInterface $url, ResultFactory $resultFactory)
$this->coreRegistry = $registry;
$this->url = $url;
$this->resultFactory = $resultFactory;
public function aroundGetRedirect ($subject, Closure $proceed)
if ($this->coreRegistry->registry('is_new_account'))
/** @var MagentoFrameworkControllerResultRedirect $result */
$result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$result->setUrl($this->url->getUrl('custom/path'));
return $result;
return $proceed();
answered 2 mins ago
Rakesh DongaRakesh Donga
2,491316
2,491316
add a comment |
add a comment |
Try this,
Add the below code to observer, and event must be
customer_register_success
<?php
namespace VendorModuleNameObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkExceptionInputException;
class LoginSuccess implements ObserverInterface
protected $_urlInterface;
protected $_response;
public function __construct(
MagentoCustomerModelSession $customerSession,
MagentoFrameworkUrlInterface $urlInterface,
MagentoFrameworkAppResponseFactory $response
)
$this->_urlInterface = $urlInterface;
$this->_response = $response;
$this->customerSession = $customerSession;
public function execute(MagentoFrameworkEventObserver $observer)
if ($this->customerSession->isLoggedIn())
$redirectUrl = $this->_urlInterface->getUrl('custom_routename/controller');
$this->_response->create()
->setRedirect($redirectUrl)
->sendResponse();
exit(0);
return $this;
Hope this helps.
it will work for after customer registration
– prabhakaran7
3 mins ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
add a comment |
Try this,
Add the below code to observer, and event must be
customer_register_success
<?php
namespace VendorModuleNameObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkExceptionInputException;
class LoginSuccess implements ObserverInterface
protected $_urlInterface;
protected $_response;
public function __construct(
MagentoCustomerModelSession $customerSession,
MagentoFrameworkUrlInterface $urlInterface,
MagentoFrameworkAppResponseFactory $response
)
$this->_urlInterface = $urlInterface;
$this->_response = $response;
$this->customerSession = $customerSession;
public function execute(MagentoFrameworkEventObserver $observer)
if ($this->customerSession->isLoggedIn())
$redirectUrl = $this->_urlInterface->getUrl('custom_routename/controller');
$this->_response->create()
->setRedirect($redirectUrl)
->sendResponse();
exit(0);
return $this;
Hope this helps.
it will work for after customer registration
– prabhakaran7
3 mins ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
add a comment |
Try this,
Add the below code to observer, and event must be
customer_register_success
<?php
namespace VendorModuleNameObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkExceptionInputException;
class LoginSuccess implements ObserverInterface
protected $_urlInterface;
protected $_response;
public function __construct(
MagentoCustomerModelSession $customerSession,
MagentoFrameworkUrlInterface $urlInterface,
MagentoFrameworkAppResponseFactory $response
)
$this->_urlInterface = $urlInterface;
$this->_response = $response;
$this->customerSession = $customerSession;
public function execute(MagentoFrameworkEventObserver $observer)
if ($this->customerSession->isLoggedIn())
$redirectUrl = $this->_urlInterface->getUrl('custom_routename/controller');
$this->_response->create()
->setRedirect($redirectUrl)
->sendResponse();
exit(0);
return $this;
Hope this helps.
Try this,
Add the below code to observer, and event must be
customer_register_success
<?php
namespace VendorModuleNameObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkExceptionInputException;
class LoginSuccess implements ObserverInterface
protected $_urlInterface;
protected $_response;
public function __construct(
MagentoCustomerModelSession $customerSession,
MagentoFrameworkUrlInterface $urlInterface,
MagentoFrameworkAppResponseFactory $response
)
$this->_urlInterface = $urlInterface;
$this->_response = $response;
$this->customerSession = $customerSession;
public function execute(MagentoFrameworkEventObserver $observer)
if ($this->customerSession->isLoggedIn())
$redirectUrl = $this->_urlInterface->getUrl('custom_routename/controller');
$this->_response->create()
->setRedirect($redirectUrl)
->sendResponse();
exit(0);
return $this;
Hope this helps.
edited 1 min ago
answered 6 mins ago
Prathap GunasekaranPrathap Gunasekaran
1,8251618
1,8251618
it will work for after customer registration
– prabhakaran7
3 mins ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
add a comment |
it will work for after customer registration
– prabhakaran7
3 mins ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
it will work for after customer registration
– prabhakaran7
3 mins ago
it will work for after customer registration
– prabhakaran7
3 mins ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
Try it and let me know and add the below code in customer_register_success observer
– Prathap Gunasekaran
1 min ago
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270058%2fafter-customer-registration-need-to-redirect-custom-page-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown