Automattic\WooCommerce\Blocks\BlockTypes

ClassicTemplate::render_single_product()protectedWC 1.0

Render method for the single product template and parts.

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

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->render_single_product();

Код ClassicTemplate::render_single_product() WC 6.8.0

protected function render_single_product() {
	ob_start();

	/**
	 * Hook: woocommerce_before_main_content
	 *
	 * Called before rendering the main content for a product.
	 *
	 * @see woocommerce_output_content_wrapper() Outputs opening DIV for the content (priority 10)
	 * @see woocommerce_breadcrumb() Outputs breadcrumb trail to the current product (priority 20)
	 * @see WC_Structured_Data::generate_website_data() Outputs schema markup (priority 30)
	 */
	do_action( 'woocommerce_before_main_content' );

	while ( have_posts() ) :

		the_post();
		wc_get_template_part( 'content', 'single-product' );

	endwhile;

	/**
	 * Hook: woocommerce_after_main_content
	 *
	 * Called after rendering the main content for a product.
	 *
	 * @see woocommerce_output_content_wrapper_end() Outputs closing DIV for the content (priority 10)
	 */
	do_action( 'woocommerce_after_main_content' );

	wp_reset_postdata();

	return ob_get_clean();
}