This commit is contained in:
Hoang Huu
2020-06-18 11:09:45 +07:00
parent 22c65f696a
commit 4fe7aecb30
19 changed files with 176 additions and 93 deletions

View File

@@ -10,23 +10,9 @@ defined( 'ABSPATH' ) || exit;
$unique_id = esc_attr( opalestate_unique_id() );
$GLOBALS['group-info-column'] = 3;
if ( isset( $nobutton ) && $nobutton ) {
$grid = [
0 => 7,
1 => 4,
2 => 1,
3 => 0,
];
} else {
$grid = [
0 => 6,
1 => 3,
2 => 1,
3 => 2,
];
}
$display_more_options = isset( $display_more_options ) ? $display_more_options : true;
$max_range = isset( $max_range ) && $max_range ? $max_range : apply_filters( 'opalestate_search_geo_max_range', 10 );
$range_unit = isset( $range_unit ) ? $range_unit : 'km';
$form_classes = [
'opalestate-search-form',
@@ -43,7 +29,7 @@ $form_classes = [
<div class="searchbox-main">
<div class="searchbox-field searchbox-field--city-text">
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text' ); ?>
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text', [ 'max_range' => $max_range, 'range_unit' => $range_unit ] ); ?>
</div>
<div class="searchbox-field searchbox-field--types">

View File

@@ -27,6 +27,8 @@ if ( isset( $nobutton ) && $nobutton ) {
}
$display_more_options = isset( $display_more_options ) ? $display_more_options : true;
$max_range = isset( $max_range ) && $max_range ? $max_range : apply_filters( 'opalestate_search_geo_max_range', 10 );
$range_unit = isset( $range_unit ) ? $range_unit : 'km';
$form_classes = [
'opalestate-search-form',
@@ -39,7 +41,7 @@ $form_classes = [
<form class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $form_classes ) ) ); ?>" action="<?php echo esc_url( opalestate_get_search_link() ); ?>" method="GET">
<div class="opal-row">
<div class="col-lg-<?php echo esc_attr( $grid[0] ) ?> col-md-<?php echo esc_attr( $grid[0] ); ?> col-sm-<?php echo esc_attr( $grid[0] ); ?> col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text' ); ?>
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text', [ 'max_range' => $max_range, 'range_unit' => $range_unit ] ); ?>
</div>
<div class="col-lg-<?php echo esc_attr( $grid[1] ); ?> col-md-<?php echo esc_attr( $grid[1] ); ?> col-sm-<?php echo esc_attr( $grid[1] ); ?> col-xs-12">

View File

@@ -1,19 +1,21 @@
<?php
$max_price = 10;
$start = 1;
$unit = 'KM';
$location_text = isset( $_GET['location_text'] ) ? sanitize_text_field( $_GET['location_text'] ): "";
$geo_lat = isset( $_GET['geo_lat'] ) ? sanitize_text_field( $_GET['geo_lat'] ): "";
$geo_long = isset( $_GET['geo_long'] ) ? sanitize_text_field( $_GET['geo_long'] ): "";
$max_geo_radius = isset( $_GET['geo_radius'] ) ? sanitize_text_field( $_GET['geo_radius'] ): $start;
$data_deposit = [
<?php
$max_range = isset( $max_range ) && $max_range ? $max_range : apply_filters( 'opalestate_search_geo_max_range', 10 );
$range_unit = isset( $range_unit ) ? $range_unit : 'km';
$start = 1;
$location_text = isset( $_GET['location_text'] ) ? sanitize_text_field( $_GET['location_text'] ) : '';
$geo_lat = isset( $_GET['geo_lat'] ) ? sanitize_text_field( $_GET['geo_lat'] ) : '';
$geo_long = isset( $_GET['geo_long'] ) ? sanitize_text_field( $_GET['geo_long'] ) : '';
$max_geo_radius = isset( $_GET['geo_radius'] ) ? sanitize_text_field( $_GET['geo_radius'] ) : $start;
$radius_measure = isset( $_GET['radius_measure'] ) ? sanitize_text_field( $_GET['radius_measure'] ) : $range_unit;
$data_range = [
'id' => 'geo_radius',
'decimals' => 0,
'unit' => $unit,
'unit' => $range_unit,
'ranger_min' => 0,
'ranger_max' => $max_price,
'ranger_max' => $max_range,
'input_min' => 0,
'input_max' => $max_price,
'input_max' => $max_range,
'mode' => 1,
'start' => $max_geo_radius,
];
@@ -21,27 +23,28 @@ $data_deposit = [
?>
<div class="input-search-city opalestate-search-opal-map">
<label class="opalestate-label opalestate-label--geo-location"><?php esc_html_e( 'Location', 'opalestate-pro' ); ?></label>
<input class="form-control opal-map-search" name="location_text" value="<?php echo esc_attr( $location_text ); ?>" placeholder="<?php esc_attr_e( 'Type City or Area', 'opalestate-pro' ); ?>">
<input class="form-control opal-map-latitude" name="geo_lat" value="<?php echo esc_attr( $geo_lat ); ?>" type="hidden">
<input class="form-control opal-map-longitude" name="geo_long" type="hidden" value="<?php echo esc_attr( $geo_long ); ?>">
<div class="map-remove"><i class="fa fa-close"></i></div>
<div class="opalestate-popup opalestate-popup-geo-location">
<div class="popup-head">
<input class="form-control opal-map-search" name="location_text" value="<?php echo esc_attr( $location_text ); ?>" placeholder="<?php esc_attr_e( 'Type City or Area', 'opalestate-pro' ); ?>">
<input class="opal-map-latitude" name="geo_lat" type="hidden" value="<?php echo esc_attr( $geo_lat ); ?>">
<input class="opal-map-longitude" name="geo_long" type="hidden" value="<?php echo esc_attr( $geo_long ); ?>">
<input class="opal-map-radius-measure" name="radius_measure" type="hidden" value="<?php echo esc_attr( $radius_measure ); ?>">
<div class="map-remove"><i class="fa fa-close"></i></div>
<div class="opalestate-popup opalestate-popup-geo-location">
<div class="popup-head">
<span class="radius-status">
<span class="radius-status__number"><?php echo absint( $max_geo_radius ); ?></span>
<span class="radius-status__unit"><?php echo esc_html( $unit ); ?></span>
<span class="radius-status__unit"><?php echo esc_html( $range_unit ); ?></span>
</span>
<span><i class="fa fa-location-arrow"></i></span>
</div>
<div class="popup-body">
<div class="popup-close"><i class="fa fa-times" aria-hidden="true"></i></div>
<span><i class="fa fa-location-arrow"></i></span>
</div>
<div class="popup-body">
<div class="popup-close"><i class="fa fa-times" aria-hidden="true"></i></div>
<div class="contact-share-form-container">
<h6><?php esc_html_e( 'Show with in', 'opalestate-pro' ); ?></h6>
<div class="box-content ">
<?php opalesate_property_slide_ranger_template( esc_html__( 'Radius', 'opalestate-pro' ), $data_deposit ); ?>
<?php opalesate_property_slide_ranger_template( esc_html__( 'Radius', 'opalestate-pro' ), $data_range ); ?>
<p><?php esc_html_e( 'Of My Location', 'opalestate-pro' ); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -12,6 +12,8 @@ $GLOBALS['group-info-column'] = 1;
$display_more_options = isset( $display_more_options ) ? $display_more_options : true;
$info_number_input = isset( $info_number_input ) ? $info_number_input : true;
$type = $info_number_input ? 'input' : 'select';
$max_range = isset( $max_range ) && $max_range ? $max_range : apply_filters( 'opalestate_search_geo_max_range', 10 );
$range_unit = isset( $range_unit ) ? $range_unit : 'km';
$form_classes = [
'opalestate-search-form',
@@ -24,7 +26,7 @@ $form_classes = [
<form class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $form_classes ) ) ); ?>" action="<?php echo esc_url( opalestate_get_search_link() ); ?>" method="GET">
<div class="opal-form-content">
<div class="form-item form-item--location-text">
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text' ); ?>
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text', [ 'max_range' => $max_range, 'range_unit' => $range_unit ] ); ?>
</div>
<div class="form-item form-item--types">

View File

@@ -24,6 +24,8 @@ if ( isset( $nobutton ) && $nobutton ) {
}
$display_more_options = isset( $display_more_options ) ? $display_more_options : false;
$max_range = isset( $max_range ) && $max_range ? $max_range : apply_filters( 'opalestate_search_geo_max_range', 10 );
$range_unit = isset( $range_unit ) ? $range_unit : 'km';
$form_classes = [
'opalestate-search-form',
@@ -36,7 +38,7 @@ $form_classes = [
<form class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $form_classes ) ) ); ?>" action="<?php echo esc_url( opalestate_get_search_link() ); ?>" method="GET">
<div class="opal-row">
<div class="col-lg-<?php echo absint( $grid[0] ); ?> col-md-<?php echo absint( $grid[0] ); ?> col-sm-<?php echo absint( $grid[0] ); ?> col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text' ); ?>
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text', [ 'max_range' => $max_range, 'range_unit' => $range_unit ] ); ?>
</div>
<div class="col-lg-<?php echo absint( $grid[1] ); ?> col-md-<?php echo absint( $grid[1] ); ?> col-sm-<?php echo absint( $grid[1] ); ?> col-xs-12">