WC_Cart::get_cart_contents
Gets cart contents.
Method of the class: WC_Cart{}
Hooks from the method
Returns
Array. of cart items
Usage
$WC_Cart = new WC_Cart(); $WC_Cart->get_cart_contents();
Changelog
| Since 3.2.0 | Introduced. |
WC_Cart::get_cart_contents() WC Cart::get cart contents code WC 10.7.0
public function get_cart_contents() {
return apply_filters( 'woocommerce_get_cart_contents', (array) $this->cart_contents );
}