Geri
Geri

Reputation: 21

How to get_formatted_order_total() if I know order_number in WooCommerce

I want to display 'Price' and 'Payment method' for a specific order with get_formatted_order_total(), all I know is order_number.

What is the best way to get this formatted order total for a specific order?

Upvotes: 1

Views: 1850

Answers (1)

Ahmed Ginani
Ahmed Ginani

Reputation: 6650

Since it is a public function , you can use ,

$order = new WC_Order($order_id);
$string = $order->get_formatted_order_total();

Upvotes: 1

Related Questions