Php 订阅生日客户同步
我有一个问题,我找不到正确的答案。 在Magento中,我想将DOB添加到时事通讯订户中。 通过遵循本教程,我成功地做到了: 现在我在数据库和Magento的后端中看到一个DOB行。如果我在数据库中设置了一个日期(我没有使用注册表单进行测试),我会看到正确的值 我想做的唯一一件事是检查客户是否在其个人资料中设置了DOB。如果是这样,我想用他的DOB覆盖数据库中的值 这应该是可能的,因为您还可以在后端看到客户的名字和姓氏 我认为我应该更改它的文件是subscriber.php。我已经试过不同的方法了,但都没用 我想我应该在这里做点什么:Php 订阅生日客户同步,php,magento,subscriber,dob,Php,Magento,Subscriber,Dob,我有一个问题,我找不到正确的答案。 在Magento中,我想将DOB添加到时事通讯订户中。 通过遵循本教程,我成功地做到了: 现在我在数据库和Magento的后端中看到一个DOB行。如果我在数据库中设置了一个日期(我没有使用注册表单进行测试),我会看到正确的值 我想做的唯一一件事是检查客户是否在其个人资料中设置了DOB。如果是这样,我想用他的DOB覆盖数据库中的值 这应该是可能的,因为您还可以在后端看到客户的名字和姓氏 我认为我应该更改它的文件是subscriber.php。我已经试过不同的方
/**
* Load subscriber info by customer
*
* @param Mage_Customer_Model_Customer $customer
* @return Mage_Newsletter_Model_Subscriber
*/
public function loadByCustomer(Mage_Customer_Model_Customer $customer)
{
$data = $this->getResource()->loadByCustomer($customer);
$this->addData($data);
if (!empty($data) && $customer->getId() && !$this->getCustomerId()) {
$this->setCustomerId($customer->getId());
$this->setSubscriberConfirmCode($this->randomSequence());
if ($this->getStatus()==self::STATUS_NOT_ACTIVE) {
$this->setStatus($customer->getIsSubscribed() ? self::STATUS_SUBSCRIBED : self::STATUS_UNSUBSCRIBED);
}
$this->save();
}
return $this;
}
或在此:
/**
* Retrieve Subscribers Full Name if it was set
*
* @return string|null
*/
public function getSubscriberFullName()
{
$name = null;
if ($this->hasCustomerFirstname() || $this->hasCustomerLastname()) {
$name = $this->getCustomerFirstname() . ' ' . $this->getCustomerLastname();
}
return $name;
}
但我真的不知道。如果有人知道如何做到这一点,我真的很感激 Magento有自己的StackExchange站点:。你应该问问那里,谢谢。我会这么做,然后在那里搜索!