0

I'm trying to diagnose an issue with the feature Recently Viewed Products. I wonder where does Magento save Recently Viewed Products information, in Database? or in Session? if the information is saved in Database, which table does it get saved?

1

Check report_viewed_product_index table, where magento store information when visit product.

Following block is responsible for return collection:

app/code/core/Mage/Reports/Block/Product/Viewed.php

Check following class how save:

app/code/core/Mage/Reports/Model/Event/Observer.php

/**
 * View Catalog Product action
 *
 * @param Varien_Event_Observer $observer
 * @return Mage_Reports_Model_Event_Observer
 */
public function catalogProductView(Varien_Event_Observer $observer)
{
    if (!$this->_enabledReports) {
        return $this;
    }

    $productId = $observer->getEvent()->getProduct()->getId();

    Mage::getModel('reports/product_index_viewed')
        ->setProductId($productId)
        ->save()
        ->calculate();

    return $this->_event(Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW, $productId);
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.