customer_save_after and customer_register_success event in custom observer customer session is blank in mycustom fuction?Exclude a specific categoryGet User credentials with an Observer on customer_register_success eventCustomer_Register_Success Event Not workingMagento add custom options to cartShopping cart is empty after cancel the payment in magento-1.9.1.1Updating customer group from observer on customer_register_success event?Magento2 event when customer session fully initialisedObserver on customer_register_success event, not calledCustomer session undefined setData function at observerCreate event and observer for customer sign up (Magento 2)

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

Should the British be getting ready for a no-deal Brexit?

Does a dangling wire really electrocute me if I'm standing in water?

Information to fellow intern about hiring?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Is domain driven design an anti-SQL pattern?

Is there a familial term for apples and pears?

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)

Are cabin dividers used to "hide" the flex of the airplane?

How to deal with fear of taking dependencies

A poker game description that does not feel gimmicky

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Add an angle to a sphere

New order #4: World

What causes the sudden spool-up sound from an F-16 when enabling afterburner?

Calculate Levenshtein distance between two strings in Python

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

Is it wise to focus on putting odd beats on left when playing double bass drums?

Does bootstrapped regression allow for inference?

Typesetting a double Over Dot on top of a symbol

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

What is it called when one voice type sings a 'solo'?

Prime joint compound before latex paint?



customer_save_after and customer_register_success event in custom observer customer session is blank in mycustom fuction?


Exclude a specific categoryGet User credentials with an Observer on customer_register_success eventCustomer_Register_Success Event Not workingMagento add custom options to cartShopping cart is empty after cancel the payment in magento-1.9.1.1Updating customer group from observer on customer_register_success event?Magento2 event when customer session fully initialisedObserver on customer_register_success event, not calledCustomer session undefined setData function at observerCreate event and observer for customer sign up (Magento 2)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















This is my observer function for customer_register_success and customer_save_after event it execute my custom url but i m getting blank session



$customerData = Mage::getSingleton('customer/session')->getCustomer();





public function doSomething($observer)

$AccountController = $observer->getEvent()->getAccountController();
$Customer = $observer->getEvent()->getCustomer();

$session=Mage::getSingleton('customer/session');
$session->setBeforeAuthUrl(Mage::getSingleton("mymodule/session")->getCompurl().'state_new/1');
if (!$Customer->getCustomerActivated())

else
//$session->setCustomerAsLoggedIn($Customer);
$response1 = Mage::app()->getResponse(); // observers have event args



$dataarray = Mage::getSingleton("mymodule/session")->getData_array();
$sampleid=$dataarray['sampleid'];

$state=$dataarray['state'];
if($state==1)

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$url=Mage::getUrl('mymodule/mymodule/customshow');
Mage::log($url,null,"url.log");
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;








Suggest me some solution.print_r($url) $url has my custom controller url but not executing it.This is my custom controller where i want to redirect and continue the process



public function customaddAction()
($login_new==1))

Mage::getSingleton("mymodule/session")->setData('data_array',array('sampleid'=>$sampleid,'state'=>0));
$sampleid=$this->getRequest()->getParam('sampleid');

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$this->_redirect('mymodule/mymodule/customshow');

else
$this->_redirectReferer();












share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Do you want redirect to customshow or customadd action?

    – Supravat M
    Dec 9 '18 at 6:21


















0















This is my observer function for customer_register_success and customer_save_after event it execute my custom url but i m getting blank session



$customerData = Mage::getSingleton('customer/session')->getCustomer();





public function doSomething($observer)

$AccountController = $observer->getEvent()->getAccountController();
$Customer = $observer->getEvent()->getCustomer();

$session=Mage::getSingleton('customer/session');
$session->setBeforeAuthUrl(Mage::getSingleton("mymodule/session")->getCompurl().'state_new/1');
if (!$Customer->getCustomerActivated())

else
//$session->setCustomerAsLoggedIn($Customer);
$response1 = Mage::app()->getResponse(); // observers have event args



$dataarray = Mage::getSingleton("mymodule/session")->getData_array();
$sampleid=$dataarray['sampleid'];

$state=$dataarray['state'];
if($state==1)

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$url=Mage::getUrl('mymodule/mymodule/customshow');
Mage::log($url,null,"url.log");
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;








Suggest me some solution.print_r($url) $url has my custom controller url but not executing it.This is my custom controller where i want to redirect and continue the process



public function customaddAction()
($login_new==1))

Mage::getSingleton("mymodule/session")->setData('data_array',array('sampleid'=>$sampleid,'state'=>0));
$sampleid=$this->getRequest()->getParam('sampleid');

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$this->_redirect('mymodule/mymodule/customshow');

else
$this->_redirectReferer();












share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Do you want redirect to customshow or customadd action?

    – Supravat M
    Dec 9 '18 at 6:21














0












0








0








This is my observer function for customer_register_success and customer_save_after event it execute my custom url but i m getting blank session



$customerData = Mage::getSingleton('customer/session')->getCustomer();





public function doSomething($observer)

$AccountController = $observer->getEvent()->getAccountController();
$Customer = $observer->getEvent()->getCustomer();

$session=Mage::getSingleton('customer/session');
$session->setBeforeAuthUrl(Mage::getSingleton("mymodule/session")->getCompurl().'state_new/1');
if (!$Customer->getCustomerActivated())

else
//$session->setCustomerAsLoggedIn($Customer);
$response1 = Mage::app()->getResponse(); // observers have event args



$dataarray = Mage::getSingleton("mymodule/session")->getData_array();
$sampleid=$dataarray['sampleid'];

$state=$dataarray['state'];
if($state==1)

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$url=Mage::getUrl('mymodule/mymodule/customshow');
Mage::log($url,null,"url.log");
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;








Suggest me some solution.print_r($url) $url has my custom controller url but not executing it.This is my custom controller where i want to redirect and continue the process



public function customaddAction()
($login_new==1))

Mage::getSingleton("mymodule/session")->setData('data_array',array('sampleid'=>$sampleid,'state'=>0));
$sampleid=$this->getRequest()->getParam('sampleid');

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$this->_redirect('mymodule/mymodule/customshow');

else
$this->_redirectReferer();












share|improve this question
















This is my observer function for customer_register_success and customer_save_after event it execute my custom url but i m getting blank session



$customerData = Mage::getSingleton('customer/session')->getCustomer();





public function doSomething($observer)

$AccountController = $observer->getEvent()->getAccountController();
$Customer = $observer->getEvent()->getCustomer();

$session=Mage::getSingleton('customer/session');
$session->setBeforeAuthUrl(Mage::getSingleton("mymodule/session")->getCompurl().'state_new/1');
if (!$Customer->getCustomerActivated())

else
//$session->setCustomerAsLoggedIn($Customer);
$response1 = Mage::app()->getResponse(); // observers have event args



$dataarray = Mage::getSingleton("mymodule/session")->getData_array();
$sampleid=$dataarray['sampleid'];

$state=$dataarray['state'];
if($state==1)

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$url=Mage::getUrl('mymodule/mymodule/customshow');
Mage::log($url,null,"url.log");
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;








Suggest me some solution.print_r($url) $url has my custom controller url but not executing it.This is my custom controller where i want to redirect and continue the process



public function customaddAction()
($login_new==1))

Mage::getSingleton("mymodule/session")->setData('data_array',array('sampleid'=>$sampleid,'state'=>0));
$sampleid=$this->getRequest()->getParam('sampleid');

$collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
if($collection)

$this->_redirect('mymodule/mymodule/customshow');

else
$this->_redirectReferer();









magento-1.9 event-observer customer-account customer-session






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 31 '16 at 15:09









7ochem

5,84493768




5,84493768










asked Aug 26 '16 at 4:23









zestzest

3462417




3462417





bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Do you want redirect to customshow or customadd action?

    – Supravat M
    Dec 9 '18 at 6:21


















  • Do you want redirect to customshow or customadd action?

    – Supravat M
    Dec 9 '18 at 6:21

















Do you want redirect to customshow or customadd action?

– Supravat M
Dec 9 '18 at 6:21






Do you want redirect to customshow or customadd action?

– Supravat M
Dec 9 '18 at 6:21











1 Answer
1






active

oldest

votes


















0














Try below code:



Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;





share|improve this answer























  • thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

    – zest
    Aug 26 '16 at 4:52











  • I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

    – Arunendra
    Aug 26 '16 at 4:58












  • please see my updated question.I have included the controller function that i am calling from the $url

    – zest
    Aug 26 '16 at 5:07












  • Why you need to redirect it on your controller? when you can do the same thing in your observer

    – Arunendra
    Aug 26 '16 at 5:34











  • please see my updated question i am executing my code inside observer but it does not execute it

    – zest
    Aug 26 '16 at 6:32












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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f133148%2fcustomer-save-after-and-customer-register-success-event-in-custom-observer-custo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try below code:



Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;





share|improve this answer























  • thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

    – zest
    Aug 26 '16 at 4:52











  • I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

    – Arunendra
    Aug 26 '16 at 4:58












  • please see my updated question.I have included the controller function that i am calling from the $url

    – zest
    Aug 26 '16 at 5:07












  • Why you need to redirect it on your controller? when you can do the same thing in your observer

    – Arunendra
    Aug 26 '16 at 5:34











  • please see my updated question i am executing my code inside observer but it does not execute it

    – zest
    Aug 26 '16 at 6:32
















0














Try below code:



Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;





share|improve this answer























  • thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

    – zest
    Aug 26 '16 at 4:52











  • I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

    – Arunendra
    Aug 26 '16 at 4:58












  • please see my updated question.I have included the controller function that i am calling from the $url

    – zest
    Aug 26 '16 at 5:07












  • Why you need to redirect it on your controller? when you can do the same thing in your observer

    – Arunendra
    Aug 26 '16 at 5:34











  • please see my updated question i am executing my code inside observer but it does not execute it

    – zest
    Aug 26 '16 at 6:32














0












0








0







Try below code:



Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;





share|improve this answer













Try below code:



Mage::app()->getFrontController()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit;






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 26 '16 at 4:41









ArunendraArunendra

6,25331842




6,25331842












  • thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

    – zest
    Aug 26 '16 at 4:52











  • I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

    – Arunendra
    Aug 26 '16 at 4:58












  • please see my updated question.I have included the controller function that i am calling from the $url

    – zest
    Aug 26 '16 at 5:07












  • Why you need to redirect it on your controller? when you can do the same thing in your observer

    – Arunendra
    Aug 26 '16 at 5:34











  • please see my updated question i am executing my code inside observer but it does not execute it

    – zest
    Aug 26 '16 at 6:32


















  • thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

    – zest
    Aug 26 '16 at 4:52











  • I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

    – Arunendra
    Aug 26 '16 at 4:58












  • please see my updated question.I have included the controller function that i am calling from the $url

    – zest
    Aug 26 '16 at 5:07












  • Why you need to redirect it on your controller? when you can do the same thing in your observer

    – Arunendra
    Aug 26 '16 at 5:34











  • please see my updated question i am executing my code inside observer but it does not execute it

    – zest
    Aug 26 '16 at 6:32

















thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

– zest
Aug 26 '16 at 4:52





thanks for answer it doesn't redirect or do anything but when i do inspect element it shows my custom url but the user is not loggedin and give Error: Syntax error, unrecognized expression: .ytmpa-

– zest
Aug 26 '16 at 4:52













I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

– Arunendra
Aug 26 '16 at 4:58






I have doubt on this line $url = Mage::getSingleton("mymodule/session")->getCompurl().'state_new=1' please print this url in log for check your Url by using: Mage::log($url,null,"url.log")

– Arunendra
Aug 26 '16 at 4:58














please see my updated question.I have included the controller function that i am calling from the $url

– zest
Aug 26 '16 at 5:07






please see my updated question.I have included the controller function that i am calling from the $url

– zest
Aug 26 '16 at 5:07














Why you need to redirect it on your controller? when you can do the same thing in your observer

– Arunendra
Aug 26 '16 at 5:34





Why you need to redirect it on your controller? when you can do the same thing in your observer

– Arunendra
Aug 26 '16 at 5:34













please see my updated question i am executing my code inside observer but it does not execute it

– zest
Aug 26 '16 at 6:32






please see my updated question i am executing my code inside observer but it does not execute it

– zest
Aug 26 '16 at 6:32


















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f133148%2fcustomer-save-after-and-customer-register-success-event-in-custom-observer-custo%23new-answer', 'question_page');

);

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







Popular posts from this blog

Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

Fil:Tokke komm.svg

Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?