$visible_count = 0;
$total_count = count($cities);
$show_more_needed = ($total_count > 6);
/* auto expand nếu tỉnh chọn nằm ngoài top 6 */
// Auto expand nếu tỉnh được chọn nằm ngoài top 6 (dựa vào alias chứ không dùng city_filter nữa)
$auto_expand = false;
foreach ($cities as $index => $c) {
if ($index >= 6 && in_array($c->alias, $selected_aliases)) {
$auto_expand = true;
break;
}
}
?>