0

I want to export order report in csv.

With following content

Order Date
Order Day
Order Id
Ip Address
Customer Name
Customer Group
Billing Name
Billing Address
Billing City
Billing Postcode
Billing State
Billing Country
Billing Country Code
Billing Email Address
Billing Phone No
Billing Mobile No
Shipping Name
Shipping Address
Shipping City
Shipping Postal Code
Shipping State
Shipping Country
Shipping Country Code
Shipping Email Address
Shipping Telephone No
Shipping Mobile No
Tracking Company Name
Tracking No
Tracking Url
Marketplace Type
Payment Type
Payment Transaction Id
Marketplace ID
Product Title
Category Name
Brand Name
Weight
Quantity
Product Price
Gross Total
Discount Amount
Gross Amount After Discount
Shipping Cost
Tax Amount
Tax Name
Net Amount
Order Status
Last Activities

I tried this code for Ip address in Mage_Adminhtml_Block_Widget_Grid and function _prepareCollection()

$this->addColumn('remote_ip', array(
        'header'=> Mage::helper('sales')->__('Ip address'),
        'width' => '80px',
        'type'  => 'text',
        'index' => 'remote_ip',
    ));

But it is not showing anything in Ip address field.

Any help?

1

You should have this in Mage_Adminhtml_Block_Sales_Order_Grid class and in _prepareColumns function.

$this->addColumn('remote_ip', array(
        'header'=> Mage::helper('sales')->__('Ip address'),
        'width' => '80px',
        'type'  => 'text',
        'index' => 'remote_ip',
    ));

This will add new column called Ip address in sales grid.

If your order is created from admin then this field will be empty.

I would suggest not to edit core code directly, instead you should override it.

  • I think that's the same code I used @AdarshKhatri – Jatin Raikwar May 25 '16 at 7:27
  • If your order is created from admin then this field will be empty. – Adarsh Khatri May 25 '16 at 7:33
  • I am seeing all fields are empty @AdarshKhatri but there is entry of ip in database sales_flat_order table – Jatin Raikwar May 25 '16 at 8:35
  • Are you adding the code in Mage_Adminhtml_Block_Sales_Order_Grid.php file? if you are then can you show me your Grid.php? – Adarsh Khatri May 25 '16 at 14:27
  • Great, please mark as solved to help others. – Adarsh Khatri May 26 '16 at 11:05

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.