Hi Kelly,
Okay I edited the file like so :
<?php
endif;
if ( ! empty( $ct_options['hotel_district_filter'] ) ) :
?>
<div class="filter_type">
<h6><?php echo esc_html__( 'Regio', 'citytours' ) ?></h6>
<ul class="list-filter district-filter" data-base-url="<?php echo esc_url( remove_query_arg( array( 'districts', 'page' ) ) ); ?>" data-arg="districts">
<?php
$all_districts = get_terms( 'district', array('hide_empty' => 0) );
if ( ! empty( $all_districts ) ) :
foreach ( $all_districts as $district ) {
$term_id = $district->term_id;
$checked = ( in_array( $term_id, $districts ) ) ? ' checked="checked"' : '';
echo '<li><label><input type="checkbox" name="district_filter[]" value="' . esc_attr( $term_id ) . '"' . $checked . '>' . esc_html( $district->name ) . '</label></li>';
}
endif;
?>
</ul>
</div>
<div class="filter_type">
<h6><?php echo esc_html__( 'Soort', 'citytours' ) ?></h6>
<ul class="list-filter district-filter" data-base-url="<?php echo esc_url( remove_query_arg( array( 'soorten', 'page' ) ) ); ?>" data-arg="soorten">
<?php
$alle_soorten = get_terms( 'soort', array('hide_empty' => 0) );
if ( ! empty( $alle_soorten ) ) :
foreach ( $alle_soorten as $soort_filter ) {
$term_id = $soort_filter->term_id;
$checked = ( in_array( $term_id, $soort_filter ) ) ? ' checked="checked"' : '';
echo '<li><label><input type="checkbox" name="soorten[]" value="' . esc_attr( $term_id ) . '"' . $checked . '>' . esc_html( $soort_filter->name ) . '</label></li>';
}
endif;
?>
</ul>
</div>
<?php
endif;
?>
and also added the same logic as districts in the functions in /inc/frontend/hotel/functions.php .
But where does this name argument pull data from? : name="district_filter[]" That is in the districts filter in:
echo '<li><label><input type="checkbox" name="district_filter[]" value="' . esc_attr( $term_id ) . '"' . $checked . '>' . esc_html( $district->name ) . '</label></li>';
Could you advise?
thx