WC_Cart::get_cart()
Returns the contents of the cart in an array.
Description Description
Return Return
(array) contents of the cart
Source Source
File: includes/class-wc-cart.php
public function get_cart() { if ( ! did_action( 'wp_loaded' ) ) { wc_doing_it_wrong( __FUNCTION__, __( 'Get cart should not be called before the wp_loaded action.', 'woocommerce' ), '2.3' ); } if ( ! did_action( 'woocommerce_load_cart_from_session' ) ) { $this->session->get_cart_from_session(); } return array_filter( $this->get_cart_contents() ); }