Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_price_html()protectedWC 1.0

Get the price.

Method of the class: AbstractProductGrid{}

No Hooks.

Return

String. Rendered product output.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_price_html( $product );
$product(\WC_Product) (required)
Product.

AbstractProductGrid::get_price_html() code WC 9.4.2

protected function get_price_html( $product ) {
	if ( empty( $this->attributes['contentVisibility']['price'] ) ) {
		return '';
	}
	return sprintf(
		'<div class="wc-block-grid__product-price price">%s</div>',
		wp_kses_post( $product->get_price_html() )
	);
}