Automattic\WooCommerce\Blocks\BlockTypes

ClassicShortcode::render_checkoutprotectedWC 1.0

Render method for rendering the checkout shortcode.

Метод класса: ClassicShortcode{}

Хуков нет.

Возвращает

string. Rendered block type output.

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

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

Код ClassicShortcode::render_checkout() WC 11.1.0

protected function render_checkout( $attributes ) {
	if ( ! isset( WC()->cart ) ) {
		return '';
	}

	ob_start();

	echo '<div class="' . esc_attr( $this->get_container_classes( $attributes ) ) . '">';
	WC_Shortcode_Checkout::output( array() );
	echo '</div>';

	return ob_get_clean();
}