Skip to main content
edited tags
Link
popeye
  • 105
  • 3
Source Link
popeye
  • 105
  • 3

get order id on observer

this may seem a duplicate but I couldn't find one and been struggling with for quite some time now.

I'm extending Order Grid with a Column on Admin panel.

I have core_layout_block_create_after observer which, when called, addColumnAfter on $block = $observer->getBlock(); in my Observer's method:

 $block = $observer->getBlock();
    // how do I bind order id on this link
    $link = Mage::helper('adminhtml')->getUrl('adminhtml/mymodule/index');
    if ($block instanceof Mage_Adminhtml_Block_Sales_Order_Grid) {
        $block->addColumnAfter('action_cool_api',
            array(
                'header' => Mage::helper('adminhtml')->__('Cool Test'),
                'index' => 'action_cool_api',
                'type' => 'action',
                'actions'  => array(
                    array(
                        'url'     => $link,
                        'caption' => Mage::helper('adminhtml')->__('Cool'),
                    ),
                )
            ),
            'status'
        );
    }

How do I bind order id on every link?