protected function checkAnonymousProfile() { // amazon checkout is always anonymous, logoff but not clear cart if (\XLite\Core\Auth::getInstance()->isLogged()) { \XLite\Core\Auth::getInstance()->logoff(); $tmpProfile = new \XLite\Model\Profile(); $tmpProfile->setAnonymous(true); \XLite\Core\Database::getEM()->persist($tmpProfile); $this->getCart()->setProfile($tmpProfile); $this->getCart()->setOrigProfile($tmpProfile); \XLite\Core\Database::getEM()->flush(); } }
/** * Get or create cart profile * * @return \XLite\Model\Profile */ protected function getCartProfile() { $profile = $this->getCart()->getProfile(); if (!$profile) { $profile = new \XLite\Model\Profile(); $profile->setLogin(''); $profile->setOrder($this->getCart()); $profile->setAnonymous(true); $this->getCart()->setProfile($profile); $profile->create(); } return $profile; }