2

I would like to know is there a way where I could get last modified date & who modified the product in magento backend?

2

This is not available in Community Edition 'default install'.

The data is not stored. Obviously you can look at the Apache log files to see things at an IP address level if you need some forensics, however, what you are after cannot be done out-the-box with Community Edition.

In the world of extensions there are plenty of options, generally paid for. However, if you want to roll your own then this article is a good place to start:

http://inchoo.net/magento/logging-user-customer-actions-in-magento/

  • Thanks Wolfie. Do we've this option/feature in any other edition of Magento? – John Mar 10 '15 at 6:55
  • I am not on Enterprise right now so I can't check the feature set, it is documented on magento.com though so take a look there. – Henry's Cat Mar 10 '15 at 12:12
2

You can get the last modified date by calling $product->getUpdatedAt(). unfortunately you cannot know who modified it. That information is not logged.

But the getUpdatedAt method might not help you 100% of the cases either.
The value of update_at is changed only when calling specifically $product->save(). This happens when the product is saved from the backend or if you call it from a script.
updated_at is not changed if you use the update attributes mass action. See more about this bug/feature/inconsistency in here: Change updated_at date on mass action

1

Credits : Fabian Blechschmidt

link : https://github.com/firegento/firegento-adminmonitoring

class FireGento_AdminMonitoring_Adminhtml_HistoryController extends Mage_Adminhtml_Controller_Action
{
    /**
     * Inits the layout, the active menu tab and the breadcrumbs
     *
     * @return FireGento_AdminMonitoring_Adminhtml_HistoryController
     */
    protected function _initAction()
    {
        $this->loadLayout();
        $this->_setActiveMenu('system/history');
        $this->_addBreadcrumb(
            $this->getMonitoringHelper()->__('Admin Monitoring'),
            $this->getMonitoringHelper()->__('History')
        );

        $this->_title($this->getMonitoringHelper()->__('Admin Monitoring'))
            ->_title($this->getMonitoringHelper()->__('History'));

        return $this;
    }

    /**
     * Shows the history grid
     */
    public function indexAction()
    {
        $this->_initAction();
        $this->renderLayout();
    }

    /**
     * Reload the adminhtml history grid, for
     */
    public function gridAction()
    {
        $block = $this->getLayout()->createBlock('firegento_adminmonitoring/adminhtml_history_grid');
        $this->getResponse()->setBody($block->toHtml());
    }

    /**
     * View a single history grid
     */
    public function viewAction()
    {
        /* @var $history FireGento_AdminMonitoring_Model_History */
        $history = Mage::getModel('firegento_adminmonitoring/history')->load($this->getRequest()->getParam('id'));
        if (!$history->getId()) {
            $this->_redirect('*/*');

            return;
        }

        Mage::register('current_history', $history, true);

        $this->_initAction();
        $this->renderLayout();
    }

    /**
     * Reverts a history entry
     */
    public function revertAction()
    {
        /* @var $history FireGento_AdminMonitoring_Model_History */
        $history = Mage::getModel('firegento_adminmonitoring/history')->load($this->getRequest()->getParam('id'));
        if ($history->getId()) {
            $model = $history->getOriginalModel();
            $model->addData($history->getDecodedContentDiff());
            $model->save();
            Mage::getSingleton('adminhtml/session')->addSuccess(
                $this->getMonitoringHelper()->__(
                    'Revert of %1$s with id %2$d successful',
                    $history->getObjectType(),
                    $history->getObjectId()
                )
            );
        }

        $this->_redirect('*/*');
    }

    /**
     * Retrieve the adminmonitoring helper
     *
     * @return FireGento_AdminMonitoring_Helper_Data
     */
    public function getMonitoringHelper()
    {
        return Mage::helper('firegento_adminmonitoring');
    }

    /**
     * Check is allowed access to action - needed afer security patch SUPEE-6285
     *
     * @return bool
     */
    protected function _isAllowed()
    {
        return Mage::getSingleton('admin/session')->isAllowed('system/history');
    }
}

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.