is_checkout()
Checks if the current page is the checkout page. Conditional tag.
Used By: is_checkout_pay_page()
Hooks from the function
Returns
true|false.
Usage
is_checkout();
Examples
#1 Check whether we on the Woo-commerce checkout page
if ( is_checkout() ) {
//order page
}
is_checkout() is checkout code WC 10.8.1
function is_checkout() {
/**
* Filter to allow for custom logic to determine if the checkout page is being viewed.
*
* @since 2.4.0
* @param bool $is_checkout Whether the checkout page is being viewed.
*/
return apply_filters( 'woocommerce_is_checkout', false ) || Constants::is_defined( 'WOOCOMMERCE_CHECKOUT' ) || CartCheckoutUtils::is_checkout_page();
}