1

I added new column in Sales Order Grid & successfully added title [say download] of column, now i want to add button [ say button name download1] for all rows of that column.

I did't created any column in database as i dont want to fetch anyy value from database.

enter image description here

app/code/community/Raveinfosys/Deleteorder/Block/Adminhtml/Sales/Order/Grid.php : Function : _prepareColumns()

$this->addColumn('download',
 array(
 'header'=> Mage::helper('sales')->__('download'),
 'width' => '70px',
 'index' => 'download1', 
 'type' => 'text' 
 ));
asked Nov 24, 2017 at 6:38
2
  • Try with render method it will work Commented Nov 24, 2017 at 7:12
  • @Magento2 it worked , thanks..... you can post it as an answer..... Commented Nov 24, 2017 at 7:26

2 Answers 2

1

Try with render method

**''renderer' => 'module/adminhtml_sales_order_render_delete',',**
answered Nov 24, 2017 at 7:29
0

To extend Magento 2 answer , i added as below :

app/code/community/Raveinfosys/Deleteorder/Block/Adminhtml/Sales/Order/Grid.php : Function : _prepareColumns()

if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
 $this->addColumn('action',
 array(
 'header' => Mage::helper('sales')->__('Action'),
 'width' => '100px',
 'type' => 'action',
 'getter' => 'getId',
 'renderer' => 'deleteorder/adminhtml_sales_order_render_delete',
 'filter' => false,
 'sortable' => false,
 'index' => 'stores',
 'is_system' => true,
 ));
 }

app/code/community/Raveinfosys/Deleteorder/Block/Adminhtml/Sales/Order/Render - Delete.php :

class Raveinfosys_Deleteorder_Block_Adminhtml_Sales_Order_Render_Delete extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
 public function render(Varien_Object $row)
 {
 $getData = $row->getData();
 $message = Mage::helper('sales')->__('Are you sure you want to delete this order?');
 $orderID = $getData['entity_id'];
 $view = $this->getUrl('*/sales_order/view',array('order_id' => $orderID));
 $delete = $this->getUrl('*/deleteorder/delete',array('order_id' => $orderID));
 $link = '<a href="'.$download.'">Download</a>&nbsp;&nbsp;&nbsp;&nbsp;<a>';
 return $link;
 }
}
answered Nov 24, 2017 at 7:33
2

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.