Automattic\WooCommerce\Admin\Features\ProductBlockEditor

Init::get_default_product_templates()privateWC 1.0

Get default product templates.

Method of the class: Init{}

No Hooks.

Return

Array. The default templates.

Usage

// private - for code of main (parent) class only
$result = $this->get_default_product_templates();

Init::get_default_product_templates() code WC 9.7.1

private function get_default_product_templates() {
	$templates   = array();
	$templates[] = new ProductTemplate(
		array(
			'id'                 => 'standard-product-template',
			'title'              => __( 'Standard product', 'woocommerce' ),
			'description'        => __( 'A single physical or virtual product, e.g. a t-shirt or an eBook.', 'woocommerce' ),
			'order'              => 10,
			'icon'               => 'shipping',
			'layout_template_id' => 'simple-product',
			'product_data'       => array(
				'type' => ProductType::SIMPLE,
			),
		)
	);
	$templates[] = new ProductTemplate(
		array(
			'id'                 => 'grouped-product-template',
			'title'              => __( 'Grouped product', 'woocommerce' ),
			'description'        => __( 'A set of products that go well together, e.g. camera kit.', 'woocommerce' ),
			'order'              => 20,
			'icon'               => 'group',
			'layout_template_id' => 'simple-product',
			'product_data'       => array(
				'type' => ProductType::GROUPED,
			),
		)
	);
	$templates[] = new ProductTemplate(
		array(
			'id'                 => 'affiliate-product-template',
			'title'              => __( 'Affiliate product', 'woocommerce' ),
			'description'        => __( 'A link to a product sold on a different website, e.g. brand collab.', 'woocommerce' ),
			'order'              => 30,
			'icon'               => 'link',
			'layout_template_id' => 'simple-product',
			'product_data'       => array(
				'type' => ProductType::EXTERNAL,
			),
		)
	);

	return $templates;
}