This commit is contained in:
Alpha 2020-07-24 09:27:03 +07:00
parent 920a1cbe1a
commit 74ef353f31
4 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,6 @@
= 1.6.4 - 2020-07-24 =
* Fixes - Mortage started price
= 1.6.3 - 2020-07-21 =
* Added - Login to show settings

View File

@ -3,7 +3,7 @@
* Plugin Name: Opal Estate Pro
* Plugin URI: https://wpdocs.gitbook.io/opal-estate/
* Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website.
* Version: 1.6.3
* Version: 1.6.4
* Author: WPOPAL
* Author URI: http://www.wpopal.com
* Requires at least: 4.9
@ -154,7 +154,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
*/
public function __clone() {
// Cloning instances of the class is forbidden
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.6.3' );
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.6.4' );
}
/**
@ -163,7 +163,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
public function setup_constants() {
// Plugin version
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
define( 'OPALESTATE_VERSION', '1.6.3' );
define( 'OPALESTATE_VERSION', '1.6.4' );
}
// Plugin Folder Path

View File

@ -4,7 +4,7 @@ Donate link: https://wpdocs.gitbook.io/opal-estate/
Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace
Requires at least: 4.9
Tested up to: 5.3.2
Stable tag: 1.6.3
Stable tag: 1.6.4
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -150,6 +150,9 @@ This section describes how to install the plugin and get it working.
* System tickets support 24/7 available : [free support](https://themelexus.ticksy.com/ "Visit the Plugin support Page")
== Changelog ==
= 1.6.4 - 2020-07-24 =
* Fixes - Mortage started price
= 1.6.3 - 2020-07-21 =
* Added - Login to show settings

View File

@ -29,7 +29,7 @@ wp_localize_script( 'opalestate-scripts', 'opalestate_mortgage',
$max_price = (int) ( $property && $property->get_price() ) ? $property->get_price() : opalestate_options( 'search_max_price', 10000000 );
$max_price = str_replace( [ ",", "." ], "", $max_price );
$start_price = $max_price;
$start_price = apply_filters( 'opalestate_mortgage_start_price', $max_price );
$max_price = apply_filters( 'opalestate_mortgage_max_price', $max_price + ( $max_price * 20 / 100 ) );
@ -37,10 +37,11 @@ $rate_start = apply_filters( 'opalestate_mortgage_rate_start', 10
$interest_rate_start = $rate_start / 100;
$years_start = apply_filters( 'opalestate_mortgage_years_start', 2 );
$deposit_start = apply_filters( 'opalestate_mortgage_deposit_start', $max_price / 2 );
$loan_amount = $max_price - $deposit_start;
$loan_amount = $start_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 );
var_dump( $max_price );
$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;