Decimal Separator in price woocommerce

Hi everyone I have this configuration in my woocommerce enter image description here

And in my product I have this enter image description here

Read More

but when I show the price it return me “4.95” instead of “4,95”

I use this to get the price

$price = get_post_meta( get_the_ID(), '_regular_price', true);

Any idea!

Related posts

Leave a Reply

1 comment

  1. Use the wc_price function to format the number.

    $price = get_post_meta( get_the_ID(), '_regular_price', true);
    $formatted_price = wc_price( $price );
    

    Note: For versions < 2.1.0, use woocommerce_price.