WC_Tracker::get_cart_checkout_info()public staticWC 1.0

Get info about the cart & checkout pages.

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

Хуков нет.

Возвращает

Массив.

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

$result = WC_Tracker::get_cart_checkout_info();

Код WC_Tracker::get_cart_checkout_info() WC 9.3.3

public static function get_cart_checkout_info() {
	$cart_page_id     = wc_get_page_id( 'cart' );
	$checkout_page_id = wc_get_page_id( 'checkout' );

	$cart_block_data     = self::get_block_tracker_data( 'woocommerce/cart', 'cart' );
	$checkout_block_data = self::get_block_tracker_data( 'woocommerce/checkout', 'checkout' );

	$pickup_location_data = self::get_pickup_location_data();

	$additional_fields_data = self::get_checkout_additional_fields_data();

	return array(
		'cart_page_contains_cart_shortcode'         => self::post_contains_text(
			$cart_page_id,
			'[woocommerce_cart]'
		),
		'checkout_page_contains_checkout_shortcode' => self::post_contains_text(
			$checkout_page_id,
			'[woocommerce_checkout]'
		),

		'cart_page_contains_cart_block'             => $cart_block_data['page_contains_block'],
		'cart_block_attributes'                     => $cart_block_data['block_attributes'],
		'checkout_page_contains_checkout_block'     => $checkout_block_data['page_contains_block'],
		'checkout_block_attributes'                 => $checkout_block_data['block_attributes'],
		'pickup_location'                           => $pickup_location_data,
		'additional_fields'                         => $additional_fields_data,
	);
}