Add search price input layout

This commit is contained in:
Hoang Huu
2020-03-24 10:22:00 +07:00
parent 32c3a3da9a
commit 71a9c2227e
6 changed files with 77 additions and 40 deletions

View File

@@ -0,0 +1,16 @@
<label class="opalestate-label opalestate-label--price-input"><?php esc_html_e( 'Price', 'opalestate-pro' ); ?></label>
<div class="opalestate-price-input-wrap">
<div class="opalestate-price-input opalestate-price-input--min">
<input class="form-control" type="number" name="min_price" value="<?php echo esc_attr( $data['input_min'] ); ?>" placeholder="<?php esc_attr_e( 'Min Price', 'opalestate-pro' ); ?>">
<span class="opalestate-price-currency"><?php echo esc_html( $data['unit'] ); ?></span>
</div>
<div class="opalestate-price-input-separator">
<span><?php echo esc_html_x( '-', 'price input separator', 'opalestate-pro' ); ?></span>
</div>
<div class="opalestate-price-input opalestate-price-input--max">
<input class="form-control" type="number" name="max_price" value="<?php echo esc_attr( $data['input_max'] ); ?>" placeholder="<?php esc_attr_e( 'Max Price', 'opalestate-pro' ); ?>">
<span class="opalestate-price-currency"><?php echo esc_html( $data['unit'] ); ?></span>
</div>
</div>

View File

@@ -21,5 +21,8 @@ if ( opalestate_options( 'currency_position', 'before' ) == 'before' ) {
$data['unit_position'] = 'prefix';
}
?>
<?php opalesate_property_slide_ranger_template( esc_html__( 'Price', 'opalestate-pro' ), $data ); ?>
if ( 'input' === opalestate_get_option( 'price_input_type', 'slider' ) ) {
echo opalestate_load_template_path( 'search-box/fields/price-input', [ 'data' => $data ] );
} else {
opalesate_property_slide_ranger_template( esc_html__( 'Price', 'opalestate-pro' ), $data );
}