admin_url( 'admin-ajax.php' ), 'currency' => esc_attr__( $currency ), 'loan_amount_text' => esc_html__( 'Loan Amount', 'opalestate-pro' ), 'your_payment_text' => esc_html__( 'Your payment', 'opalestate-pro' ), ] ); $max_price = intval( $property && $property->get_price() ) ? $property->get_price() : opalestate_options( 'search_max_price', 10000000 ); $max_price = str_replace( ",", "", $max_price ); $max_price = str_replace( ".", "", $max_price ); $start_price = $max_price; $max_price = $max_price + ( $max_price * 20 / 100 ); $rate_start = 10; $interest_rate_start = $rate_start / 100; $years_start = 2; $deposit_start = $max_price / 2; $loan_amount = $max_price - $deposit_start; $interest_rate_month = $interest_rate_start / 12; $number_of_payments_month = $years_start * 12; $monthly = round( ( $loan_amount * $interest_rate_month ) / ( 1 - pow( 1 + $interest_rate_month, -$number_of_payments_month ) ), 2 ); $total = $deposit_start + ( $monthly * $number_of_payments_month ); $price_percent = $loan_amount / $total * 100; $deposit_percent = $deposit_start / $total * 100; $deposit_color = apply_filters( 'opalestate_deposit_color', '#2f73e9' ); $data_sale_price = [ 'id' => 'sale_price', 'decimals' => opalestate_get_price_decimals(), 'unit' => $currency, 'ranger_min' => 0, 'ranger_max' => $max_price, 'input_min' => 0, 'input_max' => $max_price, 'mode' => 1, 'start' => $start_price, ]; $data_deposit = [ 'id' => 'deposit', 'decimals' => opalestate_get_price_decimals(), 'unit' => $currency, 'ranger_min' => 0, 'ranger_max' => $max_price, 'input_min' => 0, 'input_max' => $max_price, 'mode' => 1, 'start' => $deposit_start, ]; $data_interest_rate = [ 'id' => 'interest_rate', 'unit' => '%', 'ranger_min' => 0, 'ranger_max' => 100, 'input_min' => 0, 'input_max' => 100, 'mode' => 1, 'start' => $rate_start, ]; $data_years = [ 'id' => 'years', 'ranger_min' => 0, 'ranger_max' => 30, 'input_min' => 0, 'input_max' => 30, 'mode' => 1, 'start' => $years_start, ]; if ( opalestate_options( 'currency_position', 'before' ) == 'before' ) { $data_sale_price['unit_position'] = 'prefix'; $data_deposit['unit_position'] = 'prefix'; } ?>

/