В API нашёл инфу, что нужно добавить параметр locations в запрос.
Прошу рассмотреть это исправление и по возможности внести в релиз.
исходная функция
Код: Выделить всё
public function render($module_id,$rules)
{
$html = '';
$cfg = modules::get_configuration($this->configuration(),$module_id);
$html .= '
<script type="text/javascript">
$(function(){
$("#fields_' . $rules['fields_id'] . '").suggestions({
token: "' . $cfg['api_key'] . '",
type: "' . $rules['type'] . '",
count: ' . (($cfg['count']>0 and $cfg['count']<20) ? $cfg['count']:5). ',
minChars: ' . ($cfg['minChars']>0 ? $cfg['minChars']:1). ',
/* Вызывается, когда пользователь выбирает одну из подсказок */
onSelect: function(suggestion) {
//console.log(suggestion);
' . $this->render_on_select(trim($rules['rules'])). '
}
});
})
</script>
';
return $html;
}
Код: Выделить всё
public function render($module_id,$rules)
{
$html = '';
$cfg = modules::get_configuration($this->configuration(),$module_id);
$html .= '
<script type="text/javascript">
$(function(){
$("#fields_' . $rules['fields_id'] . '").suggestions({
token: "' . $cfg['api_key'] . '",
type: "' . $rules['type'] . '",
count: ' . (($cfg['count']>0 and $cfg['count']<20) ? $cfg['count']:5). ',
minChars: ' . ($cfg['minChars']>0 ? $cfg['minChars']:1). ',
constraints: {
locations: { country: "*", city_type_full: "город" },
label: ""
},
/* Вызывается, когда пользователь выбирает одну из подсказок */
onSelect: function(suggestion) {
//console.log(suggestion);
' . $this->render_on_select(trim($rules['rules'])). '
}
});
})
</script>
';
return $html;
}