2

Can anyone provide me the working code for Observer-Event Place Order button. I have tried with **<sales_model_service_quote_submit_before>**, **<sales_order_save_after>**and **<sales_order_save_before>** But none of them working. I tried in rwd theme without any third party OPC extenions. This is my 2nd question in this problem My aim is to check and get a particular cookie and save in the order placed table along with the order when Place Order button is clicked. I think i will be able to do the cookie part but I am unable to get the observer to run in the 1st place

  • In your Mage.php file, temporarily add Mage::log($name); statement in dispatchEvent method. This will generate the list of all events in a log file at every action you take. Now, click on the "Place Order" button and see if you are getting these events fired at first place. – Prateek Nov 25 '15 at 6:09
  • yes i checked <sales_order_save_before> and <sales_order_save_after> occuring 2 times <sales_model_service_quote_submit_before> occuring 1 time. – Akash Nov 25 '15 at 9:45
  • Your previous code seems correct in that case. Update question with the exact code you are using for testing (With new event, I'd suggest working with <sales_model_service_quote_submit_before>). Only then, it will be possible to identify the issue. There is nothing new you'll find in others' code for this. – Prateek Nov 25 '15 at 9:55
1

I finally made it work using <sales_order_place_after>. Hope this might help somebody facing same issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.