Change the select to input <DataList>

  • Posts: 37
  • Thank you received: 0
9 years 11 months ago #184349

-- 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.

  • Posts: 37
  • Thank you received: 0
9 years 11 months ago #184350

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
9 years 11 months ago #184358

Hi,

You want to change the 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:
$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:
$html.='</SELECT>';
to:
$html.='</datalist>';
in the file administrator/components/com_hikashop/classes/filter.php

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

  • Posts: 37
  • Thank you received: 0
9 years 11 months ago #184393

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.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
9 years 11 months ago #184399

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.

  • Posts: 37
  • Thank you received: 0
9 years 11 months ago #184513

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.050 seconds
Powered by Kunena Forum