is_checkout()
Is_checkout - Returns true when viewing the checkout page.
Used By: is_checkout_pay_page()
Hooks from the function
Return
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 9.5.1
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' ); }