How do I get the Woocommerce product price I would get using <?php echo $product->get_price_html(); ?>
in a non Timber Wordpress template?
I tried {{ product.price }}
but it triggers an error which says:
price was called incorrectly. Product properties should not be accessed directly.
I know that I can get it through the Woocommerce template using {% do action('woocommerce_single_product_summary') %}
, but:
- I want the raw unformatted text, not the content of the Woocommerce template.
- the Woocommerce action also gets a bunch of other stuff I don't need.
So, how do I access it correctly?