Automattic\WooCommerce\Blocks\Templates

SingleProductTemplateCompatibility::set_hook_data()protectedWC 1.0

Set supported hooks.

Method of the class: SingleProductTemplateCompatibility{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->set_hook_data();

SingleProductTemplateCompatibility::set_hook_data() code WC 9.0.1

protected function set_hook_data() {
	$this->hook_data = array(
		'woocommerce_before_main_content'           => array(
			'block_names' => array(),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_output_content_wrapper' => 10,
				'woocommerce_breadcrumb'             => 20,
			),
		),
		'woocommerce_after_main_content'            => array(
			'block_names' => array(),
			'position'    => 'after',
			'hooked'      => array(
				'woocommerce_output_content_wrapper_end' => 10,
			),
		),
		'woocommerce_sidebar'                       => array(
			'block_names' => array(),
			'position'    => 'after',
			'hooked'      => array(
				'woocommerce_get_sidebar' => 10,
			),
		),
		'woocommerce_before_single_product'         => array(
			'block_names' => array(),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_output_all_notices' => 10,
			),
		),
		'woocommerce_before_single_product_summary' => array(
			'block_names' => array( 'core/post-excerpt' ),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_show_product_sale_flash' => 10,
				'woocommerce_show_product_images'     => 20,
			),
		),
		'woocommerce_single_product_summary'        => array(
			'block_names' => array( 'core/post-excerpt' ),
			'position'    => 'before',
			'hooked'      => array(
				'woocommerce_template_single_title'   => 5,
				'woocommerce_template_single_rating'  => 10,
				'woocommerce_template_single_price'   => 10,
				'woocommerce_template_single_excerpt' => 20,
				'woocommerce_template_single_add_to_cart' => 30,
				'woocommerce_template_single_meta'    => 40,
				'woocommerce_template_single_sharing' => 50,
			),
		),
		'woocommerce_after_single_product'          => array(
			'block_names' => array(),
			'position'    => 'after',
			'hooked'      => array(),
		),
		'woocommerce_product_meta_start'            => array(
			'block_names' => array( 'woocommerce/product-meta' ),
			'position'    => 'before',
			'hooked'      => array(),
		),
		'woocommerce_product_meta_end'              => array(
			'block_names' => array( 'woocommerce/product-meta' ),
			'position'    => 'after',
			'hooked'      => array(),
		),
		'woocommerce_share'                         => array(
			'block_names' => array( 'woocommerce/product-details' ),
			'position'    => 'before',
			'hooked'      => array(),
		),
		'woocommerce_after_single_product_summary'  => array(
			'block_names' => array( 'woocommerce/product-details' ),
			'position'    => 'after',
			'hooked'      => array(
				'woocommerce_output_product_data_tabs' => 10,
				// We want to display the upsell products after the last block that belongs to the Single Product.
				// 'woocommerce_upsell_display'           => 15.
				'woocommerce_output_related_products'  => 20,
			),
		),
	);
}