Skip to main content

Change the select to input <DataList>

11 years 10 months ago #184349 by Vorov
-- HikaShop version -- : 2.3.4.
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29

how to change the output filter select? there is code in which when data is entered displayed information data.

change the select to input <DataList>

<input name="indexCombobox1" type="text" list="indexCombobox1_datalist" id="indexCombobox1">
<datalist id="indexCombobox1_datalist">
<option label="City1" value="City1">
<option label="City2" value="City2">
<option label="City3" value="City3">
</datalist>

filter.php (1439)
if($filter->filter_data=='custom_field'){
$field=parent::getFields($filter, $datas);
if(isset($field->field_value) && is_array($field->field_value)){
foreach($field->field_value as $val){
$selectedItem='';
if(!empty($selected) && in_array($val[0], $selected)){
$selectedItem='selected="selected"';
}
if(empty($val[0]) && $field->field_required) continue;
$html.='<OPTION '.$selectedItem.' name="'.$filter->filter_data.'" value="'.$val[0].'">'.JText::_($val[1]).'</OPTION>';
}
}
}

Please Log in or Create an account to join the conversation.

11 years 10 months ago #184350 by Vorov

Please Log in or Create an account to join the conversation.

11 years 10 months ago #184358 by nicolas
Hi,

You want to change the code:
Code:
$html.='<SELECT '.$multiple.$onClick.' size='.$filter->filter_options['filter_size'].' name="filter_'.$filter->filter_namekey.$tab.'" id="filter_'.$filter->filter_namekey.'_'.$divName.$tab.'">';
to:
Code:
$html.='<input '.$multiple.$onClick.' size='.$filter->filter_options['filter_size'].' name="filter_'.$filter->filter_namekey.$tab.'" id="filter_'.$filter->filter_namekey.'_'.$divName.$tab.'" list="filter_'.$filter->filter_namekey.'_'.$divName.$tab.'_datalist" /><datalist id="filter_'.$filter->filter_namekey.'_'.$divName.$tab.'_datalist">';
and the code:
Code:
$html.='</SELECT>';
to:
Code:
$html.='</datalist>';
in the file administrator/components/com_hikashop/classes/filter.php

Please Log in or Create an account to join the conversation.

11 years 10 months ago #184393 by Vorov
reklammma.ru/ - scary obtained (((( Task failed
Mr. Nicolas, is it possible to chicagop be used to select this plugin? - ivaynberg.github.io/select2/index.html

Please Log in or Create an account to join the conversation.

11 years 10 months ago #184399 by nicolas
Hi,

This indicates an error.
Please turn on the error reporting and debug mode of the Joomla configuration and it will display an error message explaining what is the problem.
Please provide the content of the line with the error and the exact error message so that we can tell you what to do next.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #184513 by Vorov
Figured out. To display in the list correctly I removed the line

$html.='<OPTION VALUE="filter_'.$filter->filter_namekey.'">'.JText::_( 'HIKA_ALL' ).'</OPTION>';

reklammma.ru/

The filter works as it should. A drop-down list bad showed zone - country_russia26.

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum