woocommerce_get_cart_contents
Gets cart contents.
Usage
add_filter( 'woocommerce_get_cart_contents', 'wp_kama_woocommerce_get_cart_contents_filter' ); /** * Function for `woocommerce_get_cart_contents` filter-hook. * * @param $condition * * @return */ function wp_kama_woocommerce_get_cart_contents_filter( $condition ){ // filter... return $condition; }
- $condition
- -
Changelog
Since 3.2.0 | Introduced. |
Where the hook is called
woocommerce_get_cart_contents
woocommerce/includes/class-wc-cart.php 144
return apply_filters( 'woocommerce_get_cart_contents', (array) $this->cart_contents );