1

Hello is there any alternative condition for below condition. I'm using Magento 1.7.0.2.

$action = Mage::app()->getFrontController()->getAction();

if ($action->getFullActionName() == 'sales_order_reorder')  {
// Some code here
}

I got null $action.

2 Answers 2

1

again same kind of answer from my side for you,

You can try below code for your requirement

if (in_array('sales_order_reorder', Mage::app()->getLayout()->getUpdate()->getHandles())){
     //your code
}
2
  • can you please say why my conditon not work? Commented Feb 7, 2017 at 6:15
  • @KetanKpBorada I dont have idea about your condition need to check what data we get in getFrontController method and its need debugging Commented Feb 7, 2017 at 6:18
1

Use below code will work in observer to get full action name

        /*
         * Get full Action controller name in Observer
         */
        $request = Mage::app()->getRequest();
        $module = $request->getControllerModule();
        $module_controller = $request->getControllerName();
        $module_controller_action = $request->getActionName();

        $fullActionName = $module."_".$module_controller."_".$module_controller_action;

        echo $fullActionName; 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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