WooCommerce Code Reference

Product_Price extends Abstract_Product_Block_Renderer
in package

Renders a WooCommerce product price block for email.

Table of Contents

render()  : string
Render the block.
add_spacer()  : string
Add a spacer around the block.
compile_css()  : string
Compile objects containing CSS properties to a string.
get_product_from_context()  : WC_Product|null
Get product from block context.
get_styles_from_block()  : array<string|int, mixed>
Wrapper for wp_style_engine_get_styles which ensures all values are returned.
render_content()  : string
Render the product price block content for email.
apply_email_wrapper()  : string
Apply email-compatible table wrapper.
build_grouped_product_price()  : string
Build price HTML for grouped products.
build_price_from_scratch()  : string
Build price HTML completely from scratch based on product type.
build_simple_product_price()  : string
Build price HTML for simple products.
build_variable_product_price()  : string
Build price HTML for variable products.
generate_price_html()  : string
Generate clean price HTML from product data.

Methods

get_styles_from_block()

Wrapper for wp_style_engine_get_styles which ensures all values are returned.

protected get_styles_from_block(array<string|int, mixed> $block_styles[, bool $skip_convert_vars = false ]) : array<string|int, mixed>
Parameters
$block_styles : array<string|int, mixed>

Array of block styles.

$skip_convert_vars : bool = false

If true, --wp_preset--spacing--x type values will be left in the original var:preset:spacing:x format.

Return values
array<string|int, mixed>