Automattic\WooCommerce\EmailEditor\Integrations\WooCommerce\Renderer\Blocks
Product_Price::render_content
Render the product price block content for email.
Метод класса: Product_Price{}
Хуков нет.
Возвращает
string.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render_content( $block_content, $parsed_block, $rendering_context ): string;
- $block_content(строка) (обязательный)
- Block content.
- $parsed_block(массив) (обязательный)
- Parsed block.
- $rendering_context(Rendering_Context) (обязательный)
- Rendering context.
Код Product_Price::render_content() Product Price::render content WC 11.2.2
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, $rendering_context );
}