我想通过SOAP WS公开客户最近查看的项目。
我如何到达那些物品?我知道它们存储在“ reports / product_index_viewed”中;但是,我不知道哪种方法是实现这些目标的正确方法。
这是到目前为止我得到的:
public function getRecentlyViewedByCustomer($customerId)
{
Mage::log(__METHOD__);
$customer = $this->_getCustomer($customerId);
Mage::log('Getting recently viewed products of '. $customer->getName() .' ('. $customer->getEmail() .'), ID: ' . $customer->getId() );
$productCollection = Mage::getResourceModel('reports/product_index_viewed');
Mage::log(print_r($productCollection, true));
return __METHOD__;
}
public function _getCustomer($customerId)
{
$customer = Mage::getModel('customer/customer')->load($customerId);
return $customer;
}