체크 아웃 모델 saveBilling() 함수를 Mage/Checkout/Model/Type/Onepage.php에 포함 된 이벤트를 추가하는 맞춤 모듈을 만들었습니다. 모듈Magento : 모듈 기능 재 지정 -> 재정의 된 기능에 액세스 할 수있는 항목은 무엇입니까?
Notice: Undefined property: Fla_Checkout_Model_Type_Onepage::$_customerEmailExistsMessage
in /home/magento/public_html/app/code/local/Fla/Checkout/Model/Type/Onepage.php
on line 154
타당한 비트 공용 기능 saveBilling의 코드() 정확히 젠토 코어 옆으로 동일하다 : 제외 제대로이 호출마다 소성 이벤트에서, 모듈은 지금 때때로 에러가 발생 dispatchEvent() 행 및 그 이전의 주석. 오류를 던지는 섹션 :
<?php
class Fla_Checkout_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage {
public function saveBilling($data, $customerAddressId) {
/* much code removed here as not relevant to question */
/* This section throws error because $this->_customerEmailExistsMessage not found */
if (!$this->getQuote()->getCustomerId() && self::METHOD_REGISTER == $this->getQuote()->getCheckoutMethod()) {
if ($this->_customerEmailExists($address->getEmail(), Mage::app()->getWebsite()->getId())) {
return array('error' => 1, 'message' => $this->_customerEmailExistsMessage);
}
}
/* much code removed here as not relevant to question, below code works as intended*/
/* Fiascolabs added event for exporting billing data */
Mage::dispatchEvent('fla_billing_export', array('quote'=>$this->getQuote()));
return array();
}
}
나는 젠토의 핵심 코드를 참조
, 상단에, 내가 함수 덮어 쓰기에 액세스 할 수 없습니다 것 같다 선언 몇 가지 항목이있다.- 는 상수 및 공공 기능 __construct 있습니까() 내 모듈을 사용할 수?
신고 된 개인 항목 만 복제하면 되나요?
문제의 코드
은 다음과 같습니다 : 그들은 처음에는 부두처럼 보일 때문에/**
* Checkout types: Checkout as Guest, Register, Logged In Customer
*/
const METHOD_GUEST = 'guest';
const METHOD_REGISTER = 'register';
const METHOD_CUSTOMER = 'customer';
/**
* Error message of "customer already exists"
*
* @var string
*/
private $_customerEmailExistsMessage = '';
/**
* Class constructor
* Set customer already exists message
*/
public function __construct()
{
$this->_helper = Mage::helper('checkout');
$this->_customerEmailExistsMessage = $this->_helper->__('There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account.');
$this->_checkoutSession = Mage::getSingleton('checkout/session');
$this->_customerSession = Mage::getSingleton('customer/session');
}
나는 여기에 뭉칠만한 것들이있어, 설명 해줘서 고마워! –