Hi Admin,
I managed to get the input search field to kind work. I opened all the files for my default view and search for lines wehre there was anything about the combobox filter (filter_material), then I duplicated most of those lines and replaced the reference to the filter_material with searchchemical (this is the id and name of my search input field).
On my models/chemicals there was a function _buildQueryWhere() , where I inserted a couple of lines as follow,
function _buildQueryWhere()
{
$where = array();
$app = &JFactory::getApplication();
$db=& JFactory::getDBO();
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$layout = JRequest::getCmd('layout', 'default');
$baseUserState = $option . '_' . $view . '.' . $layout . '.';
if (isset($this->_active['filter']) && $this->_active['filter'])
{
$filter_material = $this->getState('filter_material');
if ($filter_material != '') $where[] = "_material_.id = " . (int)$filter_material . "";
$searchchemical = $this->getState('searchchemical'); // I INSERTED THIS LINE MYSELF
$where[] = "a.id = " . (int)$searchchemical . ""; // I INSERTED THIS LINE MYSELF
}
return parent::_buildQueryWhere($where);
}
Now it kind work, if I select the material (category) from the combobox and type an ID of a chemical in the search field it works.
But there is where the problem is, the user won't know the chemical id and the user will type a chemical name. So I tried to change this $where[] = "a.id = " . (int)$searchchemical . ""; with $where[] = "a.title = " . (int)$searchchemical . ""; But then it doesn't work.
I need help sort this $where, I am not experienced and I think this will be hard for me to write as it also can be typed in low case, have two words.
Please help with this lines??? I think this will solve my search box.
Thanks a lot
Mauricio