is_cart

Is_cart - Returns true when viewing the cart page.

Description

is_cart(); 

Usage

  1. if ( !function_exists( 'is_cart' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-conditional-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = is_cart(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-conditional-functions.php  
  1. function is_cart() { 
  2. return is_page( wc_get_page_id( 'cart' ) ) || defined( 'WOOCOMMERCE_CART' ) || wc_post_content_has_shortcode( 'woocommerce_cart' );