Formatting product prices in email orders

Question

I’m trying to format prices in case of Indian Rupees. Below is my code and it works in case of email order on hold but how to make it work in case of order-complete?

   //Indian Currency Formatter
add_filter( 'formatted_woocommerce_price','ind_currency_formatter', 100, 1 );

    function ind_currency_formatter($price){
        global $user_currency;
        if($user_currency=='inr'||$user_currency=='INR'){
            $price = preg_replace("/(d+?)(?=(dd)+(d)(?!d))(.d+)?/i", "$1,", str_replace( ',', '', $price ));
            return $price;
        }
        else{
            return $price;
        }
    }

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/formatting-product-prices-in-email-orders/">

Formatting product prices in email orders</a>
0
, , , , YeshDev 2 weeks 0 Answers 26 views 0

Leave an answer