1. Home
  2. Car Demon Code Docs
  3. Display Filters
  4. cd_price_filter

cd_price_filter

You can use this function to modify the numerical format of the vehicle price fields.

NOTE: This affects all vehicle price fields including discount, rebate, MSRP and sale price.

apply_filters( ‘cd_price_filter’, $selling_price )

add_filter( 'cd_price_filter', 'my_price', 10, 1 );
function my_price( $price ) {

    $price = number_format( $price, 2, '.', ',' );

    return $price;
}

The above example will format prices to have 2 decimal points and use a comma as the thousands separator.

Was this article helpful to you? Yes No

How can we help?