Great question — answering as the UphillTech team:
You can simply use the function without WC object. Below is the definition of that function. So you can simply use like wc_price(12) function wc_price( $price, $args = array() ) { $args = apply_filters( 'wc_price_args', wp_parse_args( $args, array( 'ex_tax_label' => false, 'currency' => '', 'decimal_separator' => wc_get_price_decimal_separator(), 'thousand_separator' => wc_get_price_thousand_separator(), 'decimals' => wc_get_price_decimals(), 'price_format' => get_woocommerce_price_format(), ) ) ); $unformatted_price = $price; $negative = $price < 0; $price = apply_filters( 'raw_woocommerce_price', floatval( $negative ? $price * -1 : $price ) ); $price = apply_filters(...
Full answer by mujuonly: https://stackoverflow.stackexchange.com/a/55168199 (CC BY-SA 4.0).
Need it done for your business? UphillTech.