/** * @save cart to session * @access public * @return TRUE on success, FALSE on fail */ public function save_cart() { EEH_Line_Item::ensure_taxes_applied($this->_grand_total); //make sure we don't cache the transaction because it can get stale if ($this->_grand_total->get_one_from_cache('Transaction') instanceof EE_Transaction && $this->_grand_total->get_one_from_cache('Transaction')->ID()) { $this->_grand_total->clear_cache('Transaction', null, true); } return EE_Registry::instance()->SSN->set_cart($this); }
/** * @save cart to session * @access public * @param bool $apply_taxes * @return TRUE on success, FALSE on fail */ public function save_cart($apply_taxes = TRUE) { if ($apply_taxes && $this->_grand_total instanceof EE_Line_Item) { EEH_Line_Item::ensure_taxes_applied($this->_grand_total); //make sure we don't cache the transaction because it can get stale if ($this->_grand_total->get_one_from_cache('Transaction') instanceof EE_Transaction && $this->_grand_total->get_one_from_cache('Transaction')->ID()) { $this->_grand_total->clear_cache('Transaction', null, true); } } if ($this->_session instanceof EE_Session) { return $this->_session->set_cart($this); } else { return false; } }