• Anna
    November 12, 2013 at 8:21 am #6581

    If you have some PHP knowledge, you’ll find these instructions useful.

    You have to look for $price = number_format($price); in the entire theme and change the price format to French format (this is the link to the PHP documentation for price format) http://php.net/manual/en/function.number-format.php

    Example:
    in single-estate_property.php file
    line 166 you’ll find
    $price = number_format($price);

    Modify to
    $price = number_format($price, 2, ',', ' ');

    pin management

     

     

    price format

    ———–

    Change price format in COMPARE form:

    In compare_listings.php you have 2 lines to change (around line 66)

    `if ($where_currency == ‘before’) {

    $price = $currency . ‘ ‘ . number_format(intval( get_post_meta($post->ID, ‘property_price’, true) ) );

    } else {

    $price = number_format( intval( get_post_meta($post->ID, ‘property_price’, true) ) ). ‘ ‘ . $currency;

    }
    `
    Look here how number format is functioning : http://php.net/manual/en/function.number-format.ph

    for ex

    $price = $currency . ' ' . number_format(intval( get_post_meta($post->ID, 'property_price', true) ) ,2,".",",");

    • This topic was modified 3 years, 1 month ago by  Anna.
    • This topic was modified 3 years ago by  Anna.
    • This topic was modified 3 years ago by  Anna.
    • This topic was modified 3 years ago by  Anna.
    • This topic was modified 3 years ago by  Anna.
    • This topic was modified 3 years ago by  Anna.
    • This topic was modified 3 years ago by  Anna.
    • This topic was modified 2 years, 10 months ago by  Anna.
    • This topic was modified 2 years, 7 months ago by  Anna.
    Anna
    November 26, 2013 at 8:54 am #8083

    Sort by price after modifying number format

    Replace this line in property-list.php :
    ‘orderby’ => ‘meta_value’,
    by
    ‘orderby’ => ‘meta_value_num’,

    It works with french number format : $price = number_format($price, 0, ‘,’, ‘ ‘);

    • This reply was modified 3 years ago by  Anna.
    Anna
    April 9, 2014 at 8:21 am #30704

    If you want to add decimals:

    First look for all number_format occurrences.

    Some times you will find
    $price = number_format( intval( get_post_meta($post->ID, ‘property_price’, true) ) ). ‘ ‘ . $currency;

    Replace intval with floatval and should be ok

    • This reply was modified 3 years ago by  Anna.
    Michele D.
    July 17, 2014 at 3:06 pm #48041

    Hi Anna… and about the box that is located in the map at the top?

    this: http://dalexdesign.net/works/img-wp-currency.jpg

    crerem
    July 18, 2014 at 1:27 pm #48274

    Hello,
    You need to edit libs/pin-management.php file. the price is set around line 140.
    Thanks

    alessiocandelma
    October 16, 2014 at 11:02 am #100008

    If I want change the prices appears in the title with a range of prices for instance: from € 100 to € 500, is it possible?

    Thanks

    Alessio

    aesse83
    October 23, 2014 at 11:30 pm #100210

    Hi all, about price format id like to change separator from ‘,’ to ‘.’, i mean for example : € 400,000 then id like to have it as 400.000,00 is it possible to modify it on wp residence? and if yes which files have i to mod? thx 🙂

    Anna
    October 28, 2014 at 1:30 pm #100387

    Hi Alessio

    Regarding

    If I want change the prices appears in the title with a range of prices for instance: from € 100 to € 500, is it possible?

    –> Search by price would not work then. You would have to convert field NUMBER to FIELD text – see this forum as it’s a lot to change – http://wpestate.org/forums/topic/change-price-field-to-text/

    Thank you
    anna

    Anna
    October 28, 2014 at 1:32 pm #100388

    Hi aesse83

    In WP RESIDENCE you have to follow the same steps.

    I did a theme search to see where the code is in WP RESIDENCE. Follow the same steps and instructions as explained above.

     

    number format residence

    Thank you
    Anna

    aesse83
    October 28, 2014 at 7:29 pm #100401

    yeah, right i’ve already fixed that and it worked out, thanks anyway anna!

    nguyentrunghoa
    October 29, 2014 at 12:44 pm #100418

    Hi Anna,

    Would you mind if share for me what software you use to find the same code ( $price = number_format($price);) on all files of the theme as the picture you show?
    http://wpestate.org/wp-content/uploads/2014/10/number-format-residence.png

    Thanks so much!

    altuner
    December 17, 2014 at 2:20 pm #101277

    Hi nguyentrunghoa,

    The used software name is: Dreamweaver ( i use version CS6)

    1.- Open the software
    2.- Press Ctrl + F (to find)
    3.- Select by Find in Folder… (and save the map where you save the theme sample: C:\Theme 1.71\wpresidence\

    If you want the price format in : €500.000 (dot replace the current comma by thousand) follow the steps:

    Copy and Past it to Find
    $price= number_format($price);

    Copy and Past it to Replace
    $price = number_format($price, 0, ‘,’, ‘.’);

    Select now Replace All

    Repeat this with:
    $price=number_format($price);

    (some files write without space between = and number)

    mmatos
    January 27, 2015 at 10:22 am #102229

    Hi!

    I have implemente this, but now when I put a price of 1200.67 It comes out with 1.200,00

    if ($price != 0) {
                   $price = number_format($price, 2, ',', '.');
                   if ($where_currency == 'before') {
                       $price = $currency . ' ' . $price;
                   } else {
                       $price = $price . ' ' . $currency;
                   }           
               }else{
                   $price='';
               }
    

    Any suggestions how to change this?

    coutogomes
    February 12, 2015 at 4:57 pm #102803

    Hi Anna,

    deveriam ser realizadas

    I understand that modifications should be realized in childtheme, because if you release a new version of the theme we lose this modifications.

    Otherwise, if we copy all files to childtheme, and you release a new version of this files, we lose yours modifications.

    Not have any other way to change de thousand separator? Like function.php or new release via theme options?

    tks.

    aromboli
    February 28, 2015 at 9:58 pm #103818

    It didn’t work for me the change in the pinmanagement file. It worked for all other files. What could the problem be?

    • This reply was modified 2 years, 3 months ago by  aromboli.
    atozreal
    August 8, 2015 at 7:10 am #118928

    yup, i already do this thing

You must be logged in to reply to this topic.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.