Automattic\WooCommerce\Blocks\BlockTypes
ClassicShortcode::render_cart
Render method for rendering the cart shortcode.
Метод класса: ClassicShortcode{}
Хуков нет.
Возвращает
Строку. Rendered block type output.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render_cart( $attributes );
- $attributes(массив) (обязательный)
- Block attributes.
Код ClassicShortcode::render_cart() ClassicShortcode::render cart WC 10.4.3
protected function render_cart( $attributes ) {
if ( ! isset( WC()->cart ) ) {
return '';
}
ob_start();
echo '<div class="' . esc_attr( $this->get_container_classes( $attributes ) ) . '">';
WC_Shortcode_Cart::output( array() );
echo '</div>';
return ob_get_clean();
}