Fix price thousand unit.
This commit is contained in:
parent
174811f428
commit
095a398559
@ -474,10 +474,11 @@ jQuery( document ).ready( function ( $ ) {
|
||||
var imax = $( '.slide-ranger-max-input', this ).val();
|
||||
var slider = $( '.slide-ranger-bar', this ).get( 0 );
|
||||
var unit_pos = $( this ).data( 'unitpos' );
|
||||
var unit_thousand = $( this ).data( 'thousand' );
|
||||
|
||||
var config_format = {
|
||||
decimals: decimals,
|
||||
thousand: ',',
|
||||
thousand: unit_thousand,
|
||||
};
|
||||
|
||||
if ( unit_pos == 'prefix' ) {
|
||||
|
@ -69,12 +69,13 @@ function opalestate_property_areasize_field_template( $template = '' ) {
|
||||
$search_max = isset( $_GET['max_area'] ) ? sanitize_text_field( $_GET['max_area'] ) : opalestate_options( 'search_max_area', 1000 );
|
||||
|
||||
$data = [
|
||||
'id' => 'area',
|
||||
'unit' => opalestate_options( 'measurement_unit', 'sq ft' ) . ' ',
|
||||
'ranger_min' => opalestate_options( 'search_min_area', 0 ),
|
||||
'ranger_max' => opalestate_options( 'search_max_area', 1000 ),
|
||||
'input_min' => $search_min,
|
||||
'input_max' => $search_max,
|
||||
'id' => 'area',
|
||||
'unit' => opalestate_options( 'measurement_unit', 'sq ft' ) . ' ',
|
||||
'ranger_min' => opalestate_options( 'search_min_area', 0 ),
|
||||
'ranger_max' => opalestate_options( 'search_max_area', 1000 ),
|
||||
'input_min' => $search_min,
|
||||
'input_max' => $search_max,
|
||||
'unit_thousand' => apply_filters( 'opalestate_areasize_unit_thousand', ',' ),
|
||||
];
|
||||
|
||||
opalesate_property_slide_ranger_template( esc_html__( 'Area', 'opalestate-pro' ), $data );
|
||||
@ -82,7 +83,7 @@ function opalestate_property_areasize_field_template( $template = '' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter( "opalestate_property_areasize_field_template", 'opalestate_property_areasize_field_template' );
|
||||
add_filter( 'opalestate_property_areasize_field_template', 'opalestate_property_areasize_field_template' );
|
||||
|
||||
/**
|
||||
* Render slider ranger template.
|
||||
@ -100,6 +101,7 @@ function opalesate_property_slide_ranger_template( $label, $data ) {
|
||||
'input_min' => 0,
|
||||
'input_max' => 1000,
|
||||
'unit_position' => 'postfix',
|
||||
'unit_thousand' => ',',
|
||||
'mode' => 2,
|
||||
'start' => '',
|
||||
];
|
||||
@ -109,7 +111,8 @@ function opalesate_property_slide_ranger_template( $label, $data ) {
|
||||
extract( $data );
|
||||
?>
|
||||
<label class="opalestate-label opalestate-label--<?php echo sanitize_title( $label ); ?>"><?php echo esc_html( $label ); ?></label>
|
||||
<div class="opal-slide-ranger" data-unit="<?php echo $unit; ?>" data-unitpos="<?php echo $unit_position ?>" data-decimals="<?php echo $decimals; ?>">
|
||||
<div class="opal-slide-ranger" data-unit="<?php echo $unit; ?>" data-unitpos="<?php echo $unit_position ?>" data-decimals="<?php echo $decimals; ?>" data-thousand="<?php echo esc_attr(
|
||||
$unit_thousand ); ?>">
|
||||
<label class="slide-ranger-label">
|
||||
<span class="slide-ranger-min-label"></span>
|
||||
<?php echo ( $mode == 2 ) ? '<i>-</i>' : ''; ?>
|
||||
|
@ -3,17 +3,18 @@ if ( ! opalestate_is_enable_price_field() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$search_min_price = isset( $_GET['min_price'] ) ? sanitize_text_field( $_GET['min_price'] ): opalestate_options( 'search_min_price', 0 );
|
||||
$search_max_price = isset( $_GET['max_price'] ) ? sanitize_text_field( $_GET['max_price'] ): opalestate_options( 'search_max_price', 10000000 );
|
||||
$search_min_price = isset( $_GET['min_price'] ) ? sanitize_text_field( $_GET['min_price'] ) : opalestate_options( 'search_min_price', 0 );
|
||||
$search_max_price = isset( $_GET['max_price'] ) ? sanitize_text_field( $_GET['max_price'] ) : opalestate_options( 'search_max_price', 10000000 );
|
||||
|
||||
$data = [
|
||||
'id' => 'price',
|
||||
'decimals' => opalestate_get_price_decimals(),
|
||||
'unit' => opalestate_currency_symbol() . ' ',
|
||||
'ranger_min' => opalestate_options( 'search_min_price', 0 ),
|
||||
'ranger_max' => opalestate_options( 'search_max_price', 10000000 ),
|
||||
'input_min' => $search_min_price,
|
||||
'input_max' => $search_max_price,
|
||||
'id' => 'price',
|
||||
'decimals' => opalestate_get_price_decimals(),
|
||||
'unit' => opalestate_currency_symbol() . ' ',
|
||||
'ranger_min' => opalestate_options( 'search_min_price', 0 ),
|
||||
'ranger_max' => opalestate_options( 'search_max_price', 10000000 ),
|
||||
'input_min' => $search_min_price,
|
||||
'input_max' => $search_max_price,
|
||||
'unit_thousand' => opalestate_options( 'thousands_separator', ',' ),
|
||||
];
|
||||
|
||||
if ( opalestate_options( 'currency_position', 'before' ) == 'before' ) {
|
||||
|
Loading…
Reference in New Issue
Block a user