nik*_*nto 6 date admin magento-1.9
我正在运行Magento v.1.9.0.1并且我在通过管理区域编辑客户时遇到问题.例如,
上次登录时间:7月11日 77914 : 23 : 48μ.μ.
上次登录(欧洲/伊斯坦布尔):2015年2月9日3 :16: 31μ.μ.
账户创建时间:2015年9月2日4 :16: 11μ.μ.
该客户于2015年2月9日注册.我搜索了一下并发现了其他Magento版本的主题,这些版本在某些日期表示Magento交换日期,因此实际创建日期(09/02/2015)与报告创建日期之间的差异( 2015年2月9日).
我找不到关于版本1.9的任何内容,也没有关于上次登录报告的年份的任何内容(7791!).
这个问题有解决方法吗?
感谢您的时间.
小智 1
在 Magento 1.8.1 中遇到了同样的问题,并针对帐户创建日期和上次登录日期应用了以下解决方案。因为 Magento 在客户编辑部分中将日转换为月以及月至今的一些方式。路径:app\code\core\Mage\Adminhtml\Block\Customer\Edit\Tab\View.php
覆盖上面文件中的以下方法:
public function getCreateDate()
{
$cutomerId = $this->getRequest()->getParam('id');
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$select = $connection->select()
->from('customer_entity', array('created_at'))
->where('entity_id=?',$cutomerId);
$rowArray = $connection->fetchRow($select);
return $this->_getCoreHelper()->formatDate($rowArray['created_at'],
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}
public function getStoreCreateDate()
{
$cutomerId = $this->getRequest()->getParam('id');
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$select = $connection->select()
->from('customer_entity', array('created_at'))
->where('entity_id=?',$cutomerId);
$rowArray = $connection->fetchRow($select);
return $this->_getCoreHelper()->formatDate($rowArray['created_at'],
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}
public function getLastLoginDate()
{
if ($date = $this->getCustomerLog()->getLoginAtTimestamp()) {
$date = Mage::app()->getLocale()->storeDate(
$this->getCustomer()->getStoreId(),
$date,
true
);
return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}
return Mage::helper('customer')->__('Never');
}
Run Code Online (Sandbox Code Playgroud)