is_cart()
Is_cart - Returns true when viewing the cart page.
No Hooks.
Return
true|false
.
Usage
is_cart();
Code of is_cart() is cart WC 6.5.1
function is_cart() { $page_id = wc_get_page_id( 'cart' ); return ( $page_id && is_page( $page_id ) ) || Constants::is_defined( 'WOOCOMMERCE_CART' ) || wc_post_content_has_shortcode( 'woocommerce_cart' ); }