cancel
Showing results for 
Search instead for 
Did you mean: 

How to get values remote_ip from table sales_flat_order?

SOLVED

How to get values remote_ip from table sales_flat_order?

Hello! I`m trying in module to get values "remote_ip" from "table sales_flat_order", but nothing to showing. Another (email, order id) - show in orders grid.  My code (observer.php)

 

protected function prepareOrderCollectionJoins(&$collection, $orderItemsColumns = array()){
...............................................................................................
if ($showCustomerIP){
            $collection->getSelect()->join(
                array(
                    'order' => $collection->getTable('sales/order')
                ),
                'main_table.entity_id = order.entity_id', 
                array(                    
                    'order.remote_ip as xm_remote_ip'
                    )
            );
        }
.......................................................................................

}
    
    protected function prepareGrid(&$grid, $export = FALSE){
...................................................................................................
if (intval($showCustomerIP) > 0){
            $grid->addColumn('xm_customer_ip', array(
                'header' => Mage::helper('amogrid')->__('Customer IP'),
                'index' => 'xm_customer_ip',
                'width' => 80,
                'filter_index' => 'order.remote_ip'

            ));
        }
.................................................................................................
}

Anybody help?

 UPD. I found my errors. This is update code.

 

$grid->addColumn('xm_remote_ip', array(
                'header' => Mage::helper('amogrid')->__('Customer IP'),
                'index' => 'xm_remote_ip',
middle developer
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to get values remote_ip from table sales_flat_order?

@Agypten,

Please verify with your order if order was placed using Admin panel,

If order placed using admin panel, at that time remote_ip field will emtpy otherwise order placed using frontend remote ip will display based on customer remote ip.

 

So please verify above scenario and check again.

 

If issue solved, Click Kudos/Accept as solutions.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

View solution in original post

1 REPLY 1

Re: How to get values remote_ip from table sales_flat_order?

@Agypten,

Please verify with your order if order was placed using Admin panel,

If order placed using admin panel, at that time remote_ip field will emtpy otherwise order placed using frontend remote ip will display based on customer remote ip.

 

So please verify above scenario and check again.

 

If issue solved, Click Kudos/Accept as solutions.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial