0

I have added customized column in sales_flat_quote_address table. Now I want to display the same in admin i.e Sales.

I have one another module, app\code\local\Devsters\Pay\Adminhtml\Block\Sales\Order\Totals.php in that I added

 protected function _initTotals()
{
       $this->addTotalBefore(new Varien_Object(array(
            'code'      => 'customised_discount',
            'value'     => $customised_discount,
            'base_value'=> $customised_discount,
            'label'     => $this->helper('pay')->__('Customised Discount'),
        ), array('shipping', 'tax')));
     }
    return $this;

Then it got added successfully. But I want to create new module for that.

enter image description here

2

You have to change in two different files

You can set header from

app/design/adminhtml/default/default/template/sales/order/view/items.phtml

and add data from

app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml

if you want to change collection you can change collection from

Mage_Adminhtml_Block_Sales_Order_View_Items

You order total block you need to change

app/design/adminhtml/default/default/template/sales/order/totals.phtml

for the magento best prectice please override all file

  • I have set header properly but now issue is that I am not able to fetch value of customised_discount column – jassi Dec 27 '16 at 6:13
  • You save value in wrong table you have to save values in sales_flat_order_item – Vaibhav Ahalpara Dec 27 '16 at 6:25
  • thanks, adding column in Items Ordered got successful and now want to display customised_discount in Order Totals. – jassi Dec 27 '16 at 6:52
  • If this answer is currect then you can accept so other member find usefull – Vaibhav Ahalpara Dec 27 '16 at 7:02
  • 1
    For second part I have added column in app\code\local\Mage\Adminhtml\Block\Sales\Totals.php – jassi Dec 27 '16 at 10:10

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.