WC_Tracker::get_mini_cart_info()private staticWC 1.0

Get info about the Mini Cart Block.

Метод класса: WC_Tracker{}

Хуков нет.

Возвращает

Массив.

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

$result = WC_Tracker::get_mini_cart_info();

Код WC_Tracker::get_mini_cart_info() WC 9.4.2

private static function get_mini_cart_info() {
	$mini_cart_block_name = 'woocommerce/mini-cart';
	$mini_cart_block_data = wc_current_theme_is_fse_theme() ? BlocksUtil::get_block_from_template_part( $mini_cart_block_name, 'header' ) : BlocksUtil::get_blocks_from_widget_area( $mini_cart_block_name );
	return array(
		'mini_cart_used'             => empty( $mini_cart_block_data[0] ) ? 'No' : 'Yes',
		'mini_cart_block_attributes' => empty( $mini_cart_block_data[0] ) ? array() : $mini_cart_block_data[0]['attrs'],
	);
}