WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::render() protected WC 1.0

Include and render the dynamic block.

{} It's a method of the class: AbstractProductGrid{}

No Hooks.

Return

String. Rendered block type output.

Usage

// protected - for code of main (parent) or child class
$result = $this->render( $attributes, $content );
$attributes(array)
Block attributes.
Default: empty array
$content(string)
Block content.
Default: empty string

Code of AbstractProductGrid::render() WC 5.6.0

protected function render( $attributes = array(), $content = '' ) {
	$this->attributes = $this->parse_attributes( $attributes );
	$this->content    = $content;
	$this->query_args = $this->parse_query_args();
	$products         = array_filter( array_map( 'wc_get_product', $this->get_products() ) );

	if ( ! $products ) {
		return '';
	}

	/**
	 * Product List Render event.
	 *
	 * Fires a WP Hook named `experimental__woocommerce_blocks-product-list-render` on render so that the client
	 * can add event handling when certain products are displayed. This can be used by tracking extensions such
	 * as Google Analytics to track impressions.
	 *
	 * Provides the list of product data (shaped like the Store API responses) and the block name.
	 */
	$this->asset_api->add_inline_script(
		'wp-hooks',
		'
		window.addEventListener( "DOMContentLoaded", () => {
			wp.hooks.doAction(
				"experimental__woocommerce_blocks-product-list-render",
				{
					products: JSON.parse( decodeURIComponent( "' . esc_js(
			rawurlencode(
				wp_json_encode(
					array_map(
						[ Package::container()->get( SchemaController::class )->get( 'product' ), 'get_item_response' ],
						$products
					)
				)
			)
		) . '" ) ),
					listName: "' . esc_js( $this->block_name ) . '"
				}
			);
		} );
		',
		'after'
	);

	return sprintf(
		'<div class="%s"><ul class="wc-block-grid__products">%s</ul></div>',
		esc_attr( $this->get_container_classes() ),
		implode( '', array_map( array( $this, 'render_product' ), $products ) )
	);
}