panosdotk
10/18/2019 - 9:37 AM

Mass Update products timestamp update

app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php

<?php
    //Tested in 1.5.1.0
	//<pre>app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php
	//find function saveAction(): 
	//find parameter.
	//$this->_getSession()->addNotice(
 
	//public function saveAction()
	//{
	//...
	//$this->_getSession()->addNotice(
	//$this->__('Please refresh "Catalog URL Rewrites" and "Product Attributes" in System -> <a href="%s">Index Management</a>', $this->getUrl('adminhtml/process/list'))
	//);
	//}
	//...
 
 
//Added hack to set update timestamp of products in MASS EDIT products starts
 Mage::log("Mass Update Products : ".$this->_getHelper()->getProductIds());
 $pk_product_ids = $this->_getHelper()->getProductIds();
 $curr_date = date("Y-m-d H:i:s");
 foreach($pk_product_ids as $product_id){
  $product = Mage::getModel('catalog/product')->load($product_id);
  $productInfoData = $product->getData();
  $productInfoData['updated_at'] = $curr_date;
  $product->setData($productInfoData);
  $product->save();
  Mage::log('<br />'.$product_id .' Updated');
 }
 //Added hack to set update timestamp of products in MASS EDIT products ends
 
 
//.....
 
 
//}</pre>
?>