Update API

This commit is contained in:
Hoang Huu 2019-10-02 16:04:45 +07:00
parent f2e6a5e5d0
commit a11080d387

View File

@ -282,19 +282,37 @@ class Property_Api extends Base_Api {
} }
} }
$property['info']['gallery'] = $gallery_data; $property['info']['gallery'] = $gallery_data;
$property['info']['price'] = opalestate_price_format( $data->get_price() ); $property['info']['price'] = opalestate_price_format( $data->get_price() );
$property['info']['map'] = $data->get_map(); $property['info']['saleprice'] = opalestate_price_format( $data->get_sale_price() );
$property['info']['address'] = $data->get_address(); $property['info']['before_price_label'] = $data->get_before_price_label();
$property['meta'] = $data->get_meta_shortinfo(); $property['info']['price_label'] = $data->get_price_label();
$property['is_featured'] = $data->is_featured(); $property['info']['map'] = $data->get_map();
$property['status'] = $data->get_status(); $property['info']['address'] = $data->get_address();
$property['labels'] = $data->get_labels(); $property['meta'] = $data->get_meta_shortinfo();
$property['locations'] = $data->get_locations(); $property['fullinfo'] = $data->get_meta_fullinfo();
$property['amenities'] = $data->get_amenities(); $property['video'] = $data->get_video_url();
$property['types'] = $data->get_types_tax(); $property['virtual_tour'] = $data->get_virtual_tour();
$property['author_type'] = $data->get_author_type(); $property['attachments'] = $data->get_attachments();
$property['author_data'] = $data->get_author_link_data(); $property['floor_plans'] = $data->get_floor_plans();
$property['is_featured'] = $data->is_featured();
$property['status'] = $data->get_status();
$property['labels'] = $data->get_labels();
$property['locations'] = $data->get_locations();
$property['facilities'] = $data->get_facilities();
$property['amenities'] = $data->get_amenities();
$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 );
$stats = new Opalestate_View_Stats( $data->get_id(), $limit );
$array_label = json_encode( $stats->get_traffic_labels() );
$array_values = json_encode( $stats->get_traffic_data_accordion() );
$property['view_stats'] = [
'labels' => $array_label,
'values' => $array_values,
];
return apply_filters( 'opalestate_api_properties_property', $property ); return apply_filters( 'opalestate_api_properties_property', $property );
} }