• Resolved sandrineledc1106

    (@sandrineledc1106)


    Hi,

    I think I’m at the last adjustments ;-p

    I’d like to keep 2 decimals in the dashboard because i’d like to charge featured ads 9.80€ for exemple. But I do not want prices with decimals for those who post an ad.

    Have you got a tip to solve that issue please ?

    Thanks a lot

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    if you would like to display the price on [adverts_list] and Advert details without the decimals then you can reformat the price by adding the code below in your theme functions.php file

    
    add_filter( "adverts_get_the_price", function( $price, $price_raw, $post_id ) {
        return round($price_raw) . "€";
    }, 10, 3 );
    

    Note this will still allow users to enter price as float in [adverts_add] but the price will be rounded in the [adverts_list] and Ad details.

    Thread Starter sandrineledc1106

    (@sandrineledc1106)

    Hi Greg,

    Thank you very much 😀

    I wish you a great day.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PRICES AND DECIMALS’ is closed to new replies.