is_checkout()WC 1.0

Is_checkout - Returns true when viewing the checkout page.

Hooks from the function

Return

true|false.

Usage

is_checkout();

Examples

0

#1 Check whether we on the Woo-commerce checkout page

if ( is_checkout() ) {
	//order page
}

is_checkout() code WC 8.7.0

function is_checkout() {
	$page_id = wc_get_page_id( 'checkout' );

	return ( $page_id && is_page( $page_id ) ) || wc_post_content_has_shortcode( 'woocommerce_checkout' ) || apply_filters( 'woocommerce_is_checkout', false ) || Constants::is_defined( 'WOOCOMMERCE_CHECKOUT' );
}