コード例 #1
0
ファイル: AmazonCheckout.php プロジェクト: kewaunited/xcart
 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();
     }
 }
コード例 #2
0
ファイル: ACustomer.php プロジェクト: kirkbauer2/kirkxc
 /**
  * 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;
 }