Admin Order Grid overridden with custom fields cannot be filtered












4















I have an issue with an overridden admin grid (sales order grid), which contains custom fields.



Those fields can be filtered, without any issue, but, when i try to filter by OrderId, an error is thrown :



SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'increment_id' in where clause is ambiguous



How can i specify the tablename before the column?



This is how i have overridden my collection :



app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php



protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());

$collection->getSelect()->join(
array("sales" => 'sales_flat_order'),
"main_table.entity_id = sales.entity_id",
array('customer_email'=>'sales.customer_email',
'coupon_code'=>'sales.coupon_code',
'coupon_rule_name'=>'sales.coupon_rule_name',
'shipping_description'=>'sales.shipping_description',
'biebersdorf_customerordercomment'=>'sales.biebersdorf_customerordercomment')
)
->join(
array("customer_info" => 'customer_entity_varchar'),
"main_table.entity_id = customer_info.entity_id ",
array('value' => 'customer_info.value')
)
->where('customer_info.attribute_id = 562')
->join(
array("customer_group_info" => 'customer_entity'),
"main_table.entity_id = customer_group_info.entity_id ",
array('group_id' => 'customer_group_info.group_id')
);
$collection->printLogQuery(true);

$this->setCollection($collection);
return parent::_prepareCollection();
}


EDIT :



protected function _prepareColumns()
{



    $this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
));


/* if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
'index' => 'store_id',
'type' => 'store',
'store_view'=> true,
'display_deleted' => true,
));
} */

$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Date commande'),
'index' => 'created_at',
'type' => 'datetime',
'width' => '100px',
));

$this->addColumn('billing_name', array(
'header' => Mage::helper('sales')->__('Bill to Name'),
'index' => 'billing_name',
));

$this->addColumn('shipping_name', array(
'header' => Mage::helper('sales')->__('Ship to Name'),
'index' => 'shipping_name',
));

/* CUSTOM FIELDS*/

$this->addColumn('customer_email', array(
'header'=> Mage::helper('customer')->__('Email'),
'width' => '80px',
'type' => 'text',
'index' => 'customer_email',
));

$this->addColumn('etablissement', array(
'header'=> Mage::helper('customer')->__('Etablissement'),
'width' => '80px',
'type' => 'text',
'index' => 'value',
));

$this->addColumn('group_id', array(
'header'=> Mage::helper('customer')->__('Groupe'),
'width' => '80px',
'index' => 'group_id',
//'type' => 'text',
'renderer' => new Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup(),
'type' => 'options',
'options' => Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup::getCustomerGroupsArray(),
));

$this->addColumn('coupon_rule_name', array(
'header'=> Mage::helper('customer')->__('code réduction'),
'width' => '80px',
'type' => 'text',
'index' => 'coupon_rule_name',
));

$this->addColumn('shipping_method', array(
'header'=> Mage::helper('sales')->__('Livraison (Méthode)'),
'width' => '80px',
'type' => 'text',
'index' => 'shipping_description',
));

$this->addColumn('biebersdorf_customerordercomment', array(
'header'=> Mage::helper('customer')->__('Commentaire client'),
'width' => '80px',
'type' => 'text',
'index' => 'biebersdorf_customerordercomment',
'filter' => false,
'sortable' => false,
));

/* CUSTOM FIELDS */

$this->addColumn('base_grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Base)'),
'index' => 'base_grand_total',
'type' => 'currency',
'currency' => 'base_currency_code',
));

$this->addColumn('grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
'index' => 'grand_total',
'type' => 'currency',
'currency' => 'order_currency_code',
));

$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
'width' => '70px',
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));

if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
$this->addColumn('action',
array(
'header' => Mage::helper('sales')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('sales')->__('View'),
'url' => array('base'=>'*/sales_order/view'),
'field' => 'order_id',
'data-column' => 'action',
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
}
$this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));

return parent::_prepareColumns();
}









share|improve this question

























  • can you put preparecolums function in question???

    – Amit Bera
    Aug 14 '14 at 14:12











  • I 've just put prepareColumns method in the question

    – Brain_Out
    Aug 14 '14 at 14:19
















4















I have an issue with an overridden admin grid (sales order grid), which contains custom fields.



Those fields can be filtered, without any issue, but, when i try to filter by OrderId, an error is thrown :



SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'increment_id' in where clause is ambiguous



How can i specify the tablename before the column?



This is how i have overridden my collection :



app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php



protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());

$collection->getSelect()->join(
array("sales" => 'sales_flat_order'),
"main_table.entity_id = sales.entity_id",
array('customer_email'=>'sales.customer_email',
'coupon_code'=>'sales.coupon_code',
'coupon_rule_name'=>'sales.coupon_rule_name',
'shipping_description'=>'sales.shipping_description',
'biebersdorf_customerordercomment'=>'sales.biebersdorf_customerordercomment')
)
->join(
array("customer_info" => 'customer_entity_varchar'),
"main_table.entity_id = customer_info.entity_id ",
array('value' => 'customer_info.value')
)
->where('customer_info.attribute_id = 562')
->join(
array("customer_group_info" => 'customer_entity'),
"main_table.entity_id = customer_group_info.entity_id ",
array('group_id' => 'customer_group_info.group_id')
);
$collection->printLogQuery(true);

$this->setCollection($collection);
return parent::_prepareCollection();
}


EDIT :



protected function _prepareColumns()
{



    $this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
));


/* if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
'index' => 'store_id',
'type' => 'store',
'store_view'=> true,
'display_deleted' => true,
));
} */

$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Date commande'),
'index' => 'created_at',
'type' => 'datetime',
'width' => '100px',
));

$this->addColumn('billing_name', array(
'header' => Mage::helper('sales')->__('Bill to Name'),
'index' => 'billing_name',
));

$this->addColumn('shipping_name', array(
'header' => Mage::helper('sales')->__('Ship to Name'),
'index' => 'shipping_name',
));

/* CUSTOM FIELDS*/

$this->addColumn('customer_email', array(
'header'=> Mage::helper('customer')->__('Email'),
'width' => '80px',
'type' => 'text',
'index' => 'customer_email',
));

$this->addColumn('etablissement', array(
'header'=> Mage::helper('customer')->__('Etablissement'),
'width' => '80px',
'type' => 'text',
'index' => 'value',
));

$this->addColumn('group_id', array(
'header'=> Mage::helper('customer')->__('Groupe'),
'width' => '80px',
'index' => 'group_id',
//'type' => 'text',
'renderer' => new Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup(),
'type' => 'options',
'options' => Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup::getCustomerGroupsArray(),
));

$this->addColumn('coupon_rule_name', array(
'header'=> Mage::helper('customer')->__('code réduction'),
'width' => '80px',
'type' => 'text',
'index' => 'coupon_rule_name',
));

$this->addColumn('shipping_method', array(
'header'=> Mage::helper('sales')->__('Livraison (Méthode)'),
'width' => '80px',
'type' => 'text',
'index' => 'shipping_description',
));

$this->addColumn('biebersdorf_customerordercomment', array(
'header'=> Mage::helper('customer')->__('Commentaire client'),
'width' => '80px',
'type' => 'text',
'index' => 'biebersdorf_customerordercomment',
'filter' => false,
'sortable' => false,
));

/* CUSTOM FIELDS */

$this->addColumn('base_grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Base)'),
'index' => 'base_grand_total',
'type' => 'currency',
'currency' => 'base_currency_code',
));

$this->addColumn('grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
'index' => 'grand_total',
'type' => 'currency',
'currency' => 'order_currency_code',
));

$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
'width' => '70px',
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));

if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
$this->addColumn('action',
array(
'header' => Mage::helper('sales')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('sales')->__('View'),
'url' => array('base'=>'*/sales_order/view'),
'field' => 'order_id',
'data-column' => 'action',
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
}
$this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));

return parent::_prepareColumns();
}









share|improve this question

























  • can you put preparecolums function in question???

    – Amit Bera
    Aug 14 '14 at 14:12











  • I 've just put prepareColumns method in the question

    – Brain_Out
    Aug 14 '14 at 14:19














4












4








4


2






I have an issue with an overridden admin grid (sales order grid), which contains custom fields.



Those fields can be filtered, without any issue, but, when i try to filter by OrderId, an error is thrown :



SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'increment_id' in where clause is ambiguous



How can i specify the tablename before the column?



This is how i have overridden my collection :



app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php



protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());

$collection->getSelect()->join(
array("sales" => 'sales_flat_order'),
"main_table.entity_id = sales.entity_id",
array('customer_email'=>'sales.customer_email',
'coupon_code'=>'sales.coupon_code',
'coupon_rule_name'=>'sales.coupon_rule_name',
'shipping_description'=>'sales.shipping_description',
'biebersdorf_customerordercomment'=>'sales.biebersdorf_customerordercomment')
)
->join(
array("customer_info" => 'customer_entity_varchar'),
"main_table.entity_id = customer_info.entity_id ",
array('value' => 'customer_info.value')
)
->where('customer_info.attribute_id = 562')
->join(
array("customer_group_info" => 'customer_entity'),
"main_table.entity_id = customer_group_info.entity_id ",
array('group_id' => 'customer_group_info.group_id')
);
$collection->printLogQuery(true);

$this->setCollection($collection);
return parent::_prepareCollection();
}


EDIT :



protected function _prepareColumns()
{



    $this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
));


/* if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
'index' => 'store_id',
'type' => 'store',
'store_view'=> true,
'display_deleted' => true,
));
} */

$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Date commande'),
'index' => 'created_at',
'type' => 'datetime',
'width' => '100px',
));

$this->addColumn('billing_name', array(
'header' => Mage::helper('sales')->__('Bill to Name'),
'index' => 'billing_name',
));

$this->addColumn('shipping_name', array(
'header' => Mage::helper('sales')->__('Ship to Name'),
'index' => 'shipping_name',
));

/* CUSTOM FIELDS*/

$this->addColumn('customer_email', array(
'header'=> Mage::helper('customer')->__('Email'),
'width' => '80px',
'type' => 'text',
'index' => 'customer_email',
));

$this->addColumn('etablissement', array(
'header'=> Mage::helper('customer')->__('Etablissement'),
'width' => '80px',
'type' => 'text',
'index' => 'value',
));

$this->addColumn('group_id', array(
'header'=> Mage::helper('customer')->__('Groupe'),
'width' => '80px',
'index' => 'group_id',
//'type' => 'text',
'renderer' => new Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup(),
'type' => 'options',
'options' => Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup::getCustomerGroupsArray(),
));

$this->addColumn('coupon_rule_name', array(
'header'=> Mage::helper('customer')->__('code réduction'),
'width' => '80px',
'type' => 'text',
'index' => 'coupon_rule_name',
));

$this->addColumn('shipping_method', array(
'header'=> Mage::helper('sales')->__('Livraison (Méthode)'),
'width' => '80px',
'type' => 'text',
'index' => 'shipping_description',
));

$this->addColumn('biebersdorf_customerordercomment', array(
'header'=> Mage::helper('customer')->__('Commentaire client'),
'width' => '80px',
'type' => 'text',
'index' => 'biebersdorf_customerordercomment',
'filter' => false,
'sortable' => false,
));

/* CUSTOM FIELDS */

$this->addColumn('base_grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Base)'),
'index' => 'base_grand_total',
'type' => 'currency',
'currency' => 'base_currency_code',
));

$this->addColumn('grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
'index' => 'grand_total',
'type' => 'currency',
'currency' => 'order_currency_code',
));

$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
'width' => '70px',
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));

if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
$this->addColumn('action',
array(
'header' => Mage::helper('sales')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('sales')->__('View'),
'url' => array('base'=>'*/sales_order/view'),
'field' => 'order_id',
'data-column' => 'action',
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
}
$this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));

return parent::_prepareColumns();
}









share|improve this question
















I have an issue with an overridden admin grid (sales order grid), which contains custom fields.



Those fields can be filtered, without any issue, but, when i try to filter by OrderId, an error is thrown :



SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'increment_id' in where clause is ambiguous



How can i specify the tablename before the column?



This is how i have overridden my collection :



app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php



protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());

$collection->getSelect()->join(
array("sales" => 'sales_flat_order'),
"main_table.entity_id = sales.entity_id",
array('customer_email'=>'sales.customer_email',
'coupon_code'=>'sales.coupon_code',
'coupon_rule_name'=>'sales.coupon_rule_name',
'shipping_description'=>'sales.shipping_description',
'biebersdorf_customerordercomment'=>'sales.biebersdorf_customerordercomment')
)
->join(
array("customer_info" => 'customer_entity_varchar'),
"main_table.entity_id = customer_info.entity_id ",
array('value' => 'customer_info.value')
)
->where('customer_info.attribute_id = 562')
->join(
array("customer_group_info" => 'customer_entity'),
"main_table.entity_id = customer_group_info.entity_id ",
array('group_id' => 'customer_group_info.group_id')
);
$collection->printLogQuery(true);

$this->setCollection($collection);
return parent::_prepareCollection();
}


EDIT :



protected function _prepareColumns()
{



    $this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
));


/* if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
'index' => 'store_id',
'type' => 'store',
'store_view'=> true,
'display_deleted' => true,
));
} */

$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Date commande'),
'index' => 'created_at',
'type' => 'datetime',
'width' => '100px',
));

$this->addColumn('billing_name', array(
'header' => Mage::helper('sales')->__('Bill to Name'),
'index' => 'billing_name',
));

$this->addColumn('shipping_name', array(
'header' => Mage::helper('sales')->__('Ship to Name'),
'index' => 'shipping_name',
));

/* CUSTOM FIELDS*/

$this->addColumn('customer_email', array(
'header'=> Mage::helper('customer')->__('Email'),
'width' => '80px',
'type' => 'text',
'index' => 'customer_email',
));

$this->addColumn('etablissement', array(
'header'=> Mage::helper('customer')->__('Etablissement'),
'width' => '80px',
'type' => 'text',
'index' => 'value',
));

$this->addColumn('group_id', array(
'header'=> Mage::helper('customer')->__('Groupe'),
'width' => '80px',
'index' => 'group_id',
//'type' => 'text',
'renderer' => new Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup(),
'type' => 'options',
'options' => Mage_Adminhtml_Block_Sales_Order_Renderer_CustomerGroup::getCustomerGroupsArray(),
));

$this->addColumn('coupon_rule_name', array(
'header'=> Mage::helper('customer')->__('code réduction'),
'width' => '80px',
'type' => 'text',
'index' => 'coupon_rule_name',
));

$this->addColumn('shipping_method', array(
'header'=> Mage::helper('sales')->__('Livraison (Méthode)'),
'width' => '80px',
'type' => 'text',
'index' => 'shipping_description',
));

$this->addColumn('biebersdorf_customerordercomment', array(
'header'=> Mage::helper('customer')->__('Commentaire client'),
'width' => '80px',
'type' => 'text',
'index' => 'biebersdorf_customerordercomment',
'filter' => false,
'sortable' => false,
));

/* CUSTOM FIELDS */

$this->addColumn('base_grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Base)'),
'index' => 'base_grand_total',
'type' => 'currency',
'currency' => 'base_currency_code',
));

$this->addColumn('grand_total', array(
'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
'index' => 'grand_total',
'type' => 'currency',
'currency' => 'order_currency_code',
));

$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
'width' => '70px',
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));

if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
$this->addColumn('action',
array(
'header' => Mage::helper('sales')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('sales')->__('View'),
'url' => array('base'=>'*/sales_order/view'),
'field' => 'order_id',
'data-column' => 'action',
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
}
$this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));

return parent::_prepareColumns();
}






grid ce-1.9.0.1






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 mins ago









Teja Bhagavan Kollepara

2,96341847




2,96341847










asked Aug 14 '14 at 14:07









Brain_OutBrain_Out

234




234













  • can you put preparecolums function in question???

    – Amit Bera
    Aug 14 '14 at 14:12











  • I 've just put prepareColumns method in the question

    – Brain_Out
    Aug 14 '14 at 14:19



















  • can you put preparecolums function in question???

    – Amit Bera
    Aug 14 '14 at 14:12











  • I 've just put prepareColumns method in the question

    – Brain_Out
    Aug 14 '14 at 14:19

















can you put preparecolums function in question???

– Amit Bera
Aug 14 '14 at 14:12





can you put preparecolums function in question???

– Amit Bera
Aug 14 '14 at 14:12













I 've just put prepareColumns method in the question

– Brain_Out
Aug 14 '14 at 14:19





I 've just put prepareColumns method in the question

– Brain_Out
Aug 14 '14 at 14:19










1 Answer
1






active

oldest

votes


















2














Hi Just add filter_index in increament_id field and it may works



        'filter_index' => 'main_table.increment_id',


and now code



$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
'filter_index' => 'main_table.increment_id',

));





share|improve this answer
























  • Thanks a lot Amit Bera ! It works like a charm !

    – Brain_Out
    Aug 14 '14 at 14:33













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f32310%2fadmin-order-grid-overridden-with-custom-fields-cannot-be-filtered%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Hi Just add filter_index in increament_id field and it may works



        'filter_index' => 'main_table.increment_id',


and now code



$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
'filter_index' => 'main_table.increment_id',

));





share|improve this answer
























  • Thanks a lot Amit Bera ! It works like a charm !

    – Brain_Out
    Aug 14 '14 at 14:33


















2














Hi Just add filter_index in increament_id field and it may works



        'filter_index' => 'main_table.increment_id',


and now code



$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
'filter_index' => 'main_table.increment_id',

));





share|improve this answer
























  • Thanks a lot Amit Bera ! It works like a charm !

    – Brain_Out
    Aug 14 '14 at 14:33
















2












2








2







Hi Just add filter_index in increament_id field and it may works



        'filter_index' => 'main_table.increment_id',


and now code



$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
'filter_index' => 'main_table.increment_id',

));





share|improve this answer













Hi Just add filter_index in increament_id field and it may works



        'filter_index' => 'main_table.increment_id',


and now code



$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
'filter_index' => 'main_table.increment_id',

));






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 14 '14 at 14:27









Amit BeraAmit Bera

58.6k1475174




58.6k1475174













  • Thanks a lot Amit Bera ! It works like a charm !

    – Brain_Out
    Aug 14 '14 at 14:33





















  • Thanks a lot Amit Bera ! It works like a charm !

    – Brain_Out
    Aug 14 '14 at 14:33



















Thanks a lot Amit Bera ! It works like a charm !

– Brain_Out
Aug 14 '14 at 14:33







Thanks a lot Amit Bera ! It works like a charm !

– Brain_Out
Aug 14 '14 at 14:33




















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f32310%2fadmin-order-grid-overridden-with-custom-fields-cannot-be-filtered%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What other Star Trek series did the main TNG cast show up in?

Berlina muro

Berlina aerponto