Abstract_Cart::get_cart_total()

Get the total of the cart.


Return

(null|float)


Top ↑

Source

File: src/Tickets/Commerce/Cart/Abstract_Cart.php

	public function get_cart_total() {
		if ( null !== $this->cart_total ) {
			return $this->cart_total;
		}

		$items = $this->get_items_in_cart( true );

		if ( empty( $items ) ) {
			return null;
		}

		foreach ( $items as $item ) {
			$this->cart_total += $item['sub_total']->get_decimal();
		}

		return $this->cart_total;
	}

Top ↑

Changelog

Changelog
Version Description
5.10.0 Introduced.