WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Blocks\BlockTypes

Cart::render() protected WC 1.0

Append frontend scripts when rendering the Cart block.

{} Это метод класса: Cart{}

Хуков нет.

Возвращает

Строку. Rendered block type output.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->render( $attributes, $content );
$attributes(массив) (обязательный)
Block attributes.
$content(строка) (обязательный)
Block content.

Код Cart::render() WC 6.1.0

protected function render( $attributes, $content ) {
	// Deregister core cart scripts and styles.
	wp_dequeue_script( 'wc-cart' );
	wp_dequeue_script( 'wc-password-strength-meter' );
	wp_dequeue_script( 'selectWoo' );
	wp_dequeue_style( 'select2' );

	// If the content contains new inner blocks, it means we're in the newer version of Cart.
	$regex_for_new_block = '/<div[\n\r\s\ta-zA-Z0-9_\-=\'"]*data-block-name="woocommerce\/filled-cart-block"[\n\r\s\ta-zA-Z0-9_\-=\'"]*>/mi';

	$is_new = preg_match( $regex_for_new_block, $content );

	if ( ! $is_new ) {
		// This fallback needs to match the default templates defined in our Blocks.
		$inner_blocks_html = '$0
		<div data-block-name="woocommerce/filled-cart-block" class="wp-block-woocommerce-filled-cart-block">
			<div data-block-name="woocommerce/cart-items-block" class="wp-block-woocommerce-cart-items-block">
				<div data-block-name="woocommerce/cart-line-items-block" class="wp-block-woocommerce-cart-line-items-block"></div>
			</div>
			<div data-block-name="woocommerce/cart-totals-block" class="wp-block-woocommerce-cart-totals-block">
				<div data-block-name="woocommerce/cart-order-summary-block" class="wp-block-woocommerce-cart-order-summary-block"></div>
				<div data-block-name="woocommerce/cart-express-payment-block" class="wp-block-woocommerce-cart-express-payment-block"></div>
				<div data-block-name="woocommerce/proceed-to-checkout-block" class="wp-block-woocommerce-proceed-to-checkout-block"></div>
				<div data-block-name="woocommerce/cart-accepted-payment-methods-block" class="wp-block-woocommerce-cart-accepted-payment-methods-block"></div>
			</div>
		</div>
		<div data-block-name="woocommerce/empty-cart-block" class="wp-block-woocommerce-empty-cart-block">
		';

		$content = preg_replace( '/<div class="[a-zA-Z0-9_\- ]*wp-block-woocommerce-cart[a-zA-Z0-9_\- ]*">/mi', $inner_blocks_html, $content );
		$content = $content . '</div>';
	}
	return $content;
}