protected function _setCollectionOrder($column) { $collection = $this->getCollection(); if ($collection) { $columnIndex = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex(); if (strpos($columnIndex, 'am_attribute_') !== FALSE) { $attribute = str_replace('am_attribute_', '', $columnIndex); $collection->addAttributeToSort($attribute, $column->getDir()); } else { if ($columnIndex == "low_stock") { $collection->getSelect()->order("low_stock " . $column->getDir()); } else { if ($columnIndex == "thumbnail") { $collection->addAttributeToSort($columnIndex, $column->getDir()); } else { parent::_setCollectionOrder($column); } } } } return $this; }