Option 1 – the unformatted price:
Use a Headline with > Dynamic Data
Data Source: Current Post
Content Source: Post Meta
Post Meta Field: _price
Option 2 – the formatted price
1. Add this PHP Snippet to your site:
add_filter( 'render_block', function( $block_content, $block ) {
if (
! empty( $block['attrs']['className'] )
&& 'ql-price' === $block['attrs']['className']
) {
$price = get_post_meta( get_the_ID(), '_price', true );
$formatted_price = wc_price( $price );
$block_content = str_replace( 'ql-price', $formatted_price , $block_content );
}
return $block_content;
}, 10, 2 );
2. Add a Headline block to your loop, and give it a static text of: ql-price
And in Advanced > Additional CSS Class(es) add: ql-price
NOTE: in both options we set the _price as the post meta field.
Woo has other values including _regular_price and _sale_price
I have tested both methods on a simple product