Automattic\WooCommerce\Blocks

BlockTemplatesRegistry::register_add_to_cart_with_options_template_part_area()publicWC 1.0

Add Add to Cart with Options to the default template part areas.

Method of the class: BlockTemplatesRegistry{}

No Hooks.

Return

Array. The supported template part areas including the Add to Cart with Options one.

Usage

$BlockTemplatesRegistry = new BlockTemplatesRegistry();
$BlockTemplatesRegistry->register_add_to_cart_with_options_template_part_area( $default_area_definitions );
$default_area_definitions(array) (required)
An array of supported area objects.

BlockTemplatesRegistry::register_add_to_cart_with_options_template_part_area() code WC 9.8.1

public function register_add_to_cart_with_options_template_part_area( $default_area_definitions ) {
	$add_to_cart_with_options_template_part_area = array(
		'area'        => 'add-to-cart-with-options',
		'label'       => __( 'Add to Cart with Options', 'woocommerce' ),
		'description' => __( 'The Add to Cart with Options templates allow defining a different layout for each product type.', 'woocommerce' ),
		'icon'        => 'add-to-cart-with-options',
		'area_tag'    => 'add-to-cart-with-options',
	);
	return array_merge( $default_area_definitions, array( $add_to_cart_with_options_template_part_area ) );
}