Automattic\WooCommerce\EmailEditor\Integrations\WooCommerce\Renderer\Blocks
Product_Price::render_content
Render the product price block content for email.
Method of the class: Product_Price{}
No Hooks.
Returns
String.
Usage
// protected - for code of main (parent) or child class $result = $this->render_content( $block_content, $parsed_block, $rendering_context ): string;
- $block_content(string) (required)
- Block content.
- $parsed_block(array) (required)
- Parsed block.
- $rendering_context(Rendering_Context) (required)
- Rendering context.
Product_Price::render_content() Product Price::render content code WC 10.4.3
protected function render_content( string $block_content, array $parsed_block, Rendering_Context $rendering_context ): string {
$product = $this->get_product_from_context( $parsed_block );
if ( ! $product ) {
return '';
}
$attributes = $parsed_block['attrs'] ?? array();
$price_content = $this->generate_price_html( $product, $attributes, $rendering_context );
return $this->apply_email_wrapper( $price_content, $parsed_block );
}