投稿日 2010年07月11日 - 08:27
勉強になりました、ありがとうございます。
恐縮ですが、ゲスト購入で注文完了の「ご注文ありがとうございました画面」から「ゲスト購入時に会員加入を促進させる画面」より会員登録に進んだ次のページの際(http://localhost/checkout/guest-registration)に
Fatal error: Call to undefined method MyAccount::save() in C:\xampplite\htdocs\live-commerce\application\catalog\controllers\CheckoutController.php on line 907
とエラーが出た場合は環境設定のミスなんでしょうか?
大変申し訳ありませんが参考までにどのようなミスが有るのかお願い致します。
追記:CheckoutController.php 907行目は $myAccount->save($guestData); でした
871行目から
/**
* ゲスト購入時に会員加入を促進させる画面を表示するアクション。
*
* @access public
*/
public function guestRegistrationAction()
{
c::doAction('checkout_guestRegistration_before');
$sessionHandler = c::getSession();
if (isset($sessionHandler->checkout_name)) {
$checkoutName = $sessionHandler->checkout_name;
} else {
$checkoutName = '';
}
$request = $this->getRequest();
$httpMethod = $request->getMethod();
if ($httpMethod == 'GET' || $checkoutName != 'guest-registration' || !isset($sessionHandler->guestBillingAddress)) {
$this->_redirect('/');
}
$chk = $request->getPost('regist');
if ($chk != '1') {
$sessionHandler->checkout_name = 'success';
$sessionHandler->guestRegistrationerrorMsg = 'pls check the checkbox';
$this->_redirect('checkout/success');
return;
}
$address = array();
$password = new Password();
//read guest address
$guestData = $sessionHandler->guestBillingAddress;
//assign random password
$password = $password->getNewPassword();
$guestData['password'] = md5($password);
try {
//insert new address for guest user
$myAccount = new MyAccount();
$myAccount->save($guestData);
//mail new password to guest customer
$subject = EMAIL_GUEST_REGIST;
$fromName = c::executeCacheForFunction('configuration', 'o::_', array('STORE_NAME'));
$fromEmail = c::executeCacheForFunction('configuration', 'o::_', array('CONTACT_EMAIL'));
$toName = c::getCustomerName($guestData['firstname'],
$guestData['lastname']);
$toEmail = $guestData['email'];
$emailbody = str_replace(array('{store}', '{name}', '{pass}', '{url}', '{email_footer}', '{email}'),
array($fromName, $toName, $password, c::link('login'),
c::executeCacheForFunction('configuration', 'o::_', array('EMAIL_FOOTER')),
$toEmail), EMAIL_GUEST_REGIST_BODY);
c::sendMail($subject, $fromName, $fromEmail, $toName, $toEmail, $emailbody);
//redirect to login page and show success page
$sessionHandler->guestRegistrationSuccessMsg = TEXT_GUEST_REGIST_SUCCESS;
c::doAction('checkout_guestRegistration_after');
$this->_redirect('login');
} catch (Exception $e) {
$sessionHandler->checkout_name = 'success';
$sessionHandler->guestRegistrationerrorMsg = TEXT_SYS_ERROR;
$msg = 'catch exception ' . __METHOD__ . ', ';
$msg .= $e->getMessage();
c::errorLog($msg, Zend_Log::ERR);
c::doAction('checkout_guestRegistration_after');
$this->_redirect('checkout/success');
}
}
933行目