Tuan_H
(Tuan H)
30 Tháng Một 2023 12:04
1
[center] [/center]
Welcome to Houzez – 1# Best Selling Real Estate WordPress theme for agents, companies and real estate professional.
Houzez is a WordPress theme specially designed for the real estate industry. It offers easy-to-use tools that will allow you to manage your agency’s content and listings, while providing the best possible experience for your clients.
LIVE PREVIEW
Tuan_H
(Tuan H)
30 Tháng Một 2023 12:05
2
Thêm giá Việt Nam Đồng vào Theme Houzez
if( !function_exists('houzez_get_property_price ') ) {
function houzez_get_property_price ( $price_number ) {
$price_number = doubleval( $price_number );
if( $price_number ) {
$currency = houzez_get_currency();
$decimals = intval(houzez_option( 'decimals' ));
$dec_point = houzez_option( 'decimal_point_separator' );
$thousands_sep = houzez_option( 'thousands_separator' );
$currency_position = houzez_option( 'currency_position' );
//THEM GIA VIET NAM DONG
$price = number_format ( $price_number , $decimals , $dec_point , $thousands_sep );
if($price > 999999999)
{
$priceTy = $price/1000000000;
$formatted_price = '<b>' .$priceTy. '</b> tỷ';
}
elseif($price > 999999)
{
$priceTy = $price/1000000;
$formatted_price = '<b>' .$priceTy. '</b> triệu';
}
elseif($price > 999)
{
$priceTy = $price/1000;
$formatted_price = '<b>' .$priceTy. '</b> ngàn';
}
else {
$priceTy = $price/1000000000;
$priceTyTy = (int)$priceTy;
$priceTrieu = $price/1000000;
$priceTrieuT = substr((int)$priceTrieu, -3);
$priceNgan = $price/1000;
$priceNganN = substr((int)$priceNgan, -3);
$formatted_price = '';
if($priceTyTy > 0 && $priceTyTy != '0' > 900000000){
$formatted_price = $formatted_price. '<b>' .$priceTyTy. '</b> tỷ ';
}
if($priceTrieuT > 0){
$formatted_price = $formatted_price. '<b>' .$priceTrieuT. '</b> triệu ';
}
if($priceNganN > 0){
$formatted_price = $formatted_price. '<b>' .$priceNganN. '</b> ngàn';
}
}
//THEM GIA VIET NAM DONG
$formatted_price=str_replace('.',',',$formatted_price);
if( $currency_position == 'before' ) {
return $currency . $formatted_price;
} else {
return $formatted_price . $currency;
}
} else {
$currency = 'invalid';
}
return $currency;
}
}
if(!function_exists('houzez_number_shorten')) {
function houzez_number_shorten($number, $precision = 0, $divisors = null) {
$number = preg_replace('/[.,]/', '', $number);
if (!isset($divisors)) {
$divisors = array(
pow(1000, 0) => '', // 1000^0 == 1
pow(1000, 1) => ' ngàn ', // Thousand
pow(1000, 2) => ' triệu ', // Million
pow(1000, 3) => ' tỷ ', // Billion
pow(1000, 4) => ' ngàn tỷ ', // Trillion
pow(1000, 5) => ' trăm tỷ ', // Quadrillion
pow(1000, 6) => ' triệu tỷ ', // Quintillion
);
}
foreach ($divisors as $divisor => $shorthand) {
if (abs($number) < ($divisor * 1000)) {
// Match found
break;
}
}
//Match found or not found use the last defined value for divisor
return number_format($number / $divisor, $precision) . $shorthand;
}
}