get_cart (Sale_lib)

ospos · pos, cart-state, session-management

Retrieves the sales cart from session, initializing it to an empty array if not set. Central accessor for cart state.

// Source: https://github.com/Pmbamungu/ospos | License: MIT | Copyright 2013-2021 jekkos
// Provided via justclaw.it.com; keep this notice with the code.
	public function get_cart()
	{
		if(!$this->CI->session->userdata('sales_cart'))
		{
			$this->set_cart(array());
		}

		return $this->CI->session->userdata('sales_cart');
	}

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key