0

How can I call my custom front-end controller action in my Observer function? Is dispatch function worked?

<?php
    ....
    public function salesOrderSaveAfter(Varien_Event_Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();
        $order_id = $order->getId();
        $state= $order->getStatus();
        //here I can call the action controller
    }
    ...
  • Why do you want to call the controller's method in the observer? – Ner Nov 14 '17 at 11:06
  • I want to create my order in Exact ERP. Exact having redirect URL so – ams Nov 14 '17 at 12:40
1

You can use:

$controller = Mage::getControllerInstance(
    'The_Controller_Class',
    Mage::app()->getRequest(),
    Mage::app()->getResponse());

Reference

  • can you explain me more about it – ams Nov 15 '17 at 5:50
  • You have a good explanation in the reference link – PЯINCƏ Nov 15 '17 at 6:06

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.