Update Magento product / inventory from external source.


Update Magento product / inventory from external source.

//Note : you can see that updated_at is changed every time //you refresh the page
$product_id = 1;
$product = Mage::getModel('catalog/product')->load($product_id);
$productInfoData = $product->getData();
$productInfoData['updated_at'] = date('Y-m-d H:i:s');
//then set product's general info to update
$product->setData($productInfoData);
$product->save();

echo "<pre>"; print_r($productInfoData); echo "</pre>";

Thanks to : http://magento4u.wordpress.com/category/magento-products/

Share on Facebook




About Pragnesh Karia

Pragnesh Karia, Open Source Enthusiast, Software Professional, Software Developer, Technical Lead ,Magento, Joomla ,Joomla LMS , Moodel LMS ,PHP ,Mysql, Ajax, Javascript, Jquery, Linux, Fan of Open Sources , Annet Technologies , SEO Analyst , Mootools