Update search
This commit is contained in:
parent
c3efdabf1b
commit
f171fe17f7
@ -139,10 +139,21 @@ function opalestate_api_get_property_data( $property_info ) {
|
|||||||
$property['labels'] = $data->get_labels();
|
$property['labels'] = $data->get_labels();
|
||||||
$property['locations'] = $data->get_locations();
|
$property['locations'] = $data->get_locations();
|
||||||
$property['facilities'] = $data->get_facilities();
|
$property['facilities'] = $data->get_facilities();
|
||||||
$property['amenities'] = $data->get_amenities();
|
|
||||||
$property['types'] = $data->get_types_tax();
|
$amenities = $data->get_amenities();
|
||||||
$property['author_type'] = $data->get_author_type();
|
$amenities_result = [];
|
||||||
$property['author_data'] = $data->get_author_link_data();
|
if ( $amenities ) {
|
||||||
|
foreach ( $amenities as $amenity ) {
|
||||||
|
$value = has_term( $amenity->term_id, 'opalestate_amenities', $property_info->ID );
|
||||||
|
$amenity->value = $value;
|
||||||
|
$amenities_result[] = $amenity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$property['amenities'] = $amenities_result;
|
||||||
|
$property['types'] = $data->get_types_tax();
|
||||||
|
$property['author_type'] = $data->get_author_type();
|
||||||
|
$property['author_data'] = $data->get_author_link_data();
|
||||||
|
|
||||||
$limit = opalestate_get_option( 'single_views_statistics_limit', 8 );
|
$limit = opalestate_get_option( 'single_views_statistics_limit', 8 );
|
||||||
$stats = new Opalestate_View_Stats( $data->get_id(), $limit );
|
$stats = new Opalestate_View_Stats( $data->get_id(), $limit );
|
||||||
|
@ -114,7 +114,7 @@ class OpalEstate_Search {
|
|||||||
[
|
[
|
||||||
'taxonomy' => 'opalestate_amenities',
|
'taxonomy' => 'opalestate_amenities',
|
||||||
'field' => 'slug',
|
'field' => 'slug',
|
||||||
'terms' => sanitize_text_field( $_GET['amenities'] ),
|
'terms' => ( $_GET['amenities'] ),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,6 @@ class OpalEstate_Search {
|
|||||||
|
|
||||||
if ( $search_min_price != '' && $search_max_price != '' && is_numeric( $search_min_price ) && is_numeric( $search_max_price ) ) {
|
if ( $search_min_price != '' && $search_max_price != '' && is_numeric( $search_min_price ) && is_numeric( $search_max_price ) ) {
|
||||||
if ( $search_min_price ) {
|
if ( $search_min_price ) {
|
||||||
|
|
||||||
array_push( $args['meta_query'], [
|
array_push( $args['meta_query'], [
|
||||||
'key' => OPALESTATE_PROPERTY_PREFIX . 'price',
|
'key' => OPALESTATE_PROPERTY_PREFIX . 'price',
|
||||||
'value' => [ $search_min_price, $search_max_price ],
|
'value' => [ $search_min_price, $search_max_price ],
|
||||||
|
Loading…
Reference in New Issue
Block a user