I want quick update of product on MAGENTO C.E 1.7
I know about the quick update of product attribute value using
below code: getResource()->saveAttribute()
just like
$product=Mage::getModel('catalog/product')->load($id);
$product->getName();
$product->setSpecialFromDate('2010-10-28');
$product->setSpecialFromDateIsFormated(true);
$product->setSpecialToDate();
$product->setSpecialToDateIsFormated(true);
/* quick save */
$product->getResource()->saveAttribute($product, 'special_from_date');
$product->getResource()->saveAttribute($product, 'special_to_date');
But i want know how can update product inventory quickly just like above product attribute update
and i have optimized my below code
// call product model and create product object
$product = Mage::getModel('catalog/product');
// Load product using product id
$product->load($product_id);
$stockData['qty'] = $v;
if($v>0){
$stockData['is_in_stock'] = 1;
}else{
$stockData['is_in_stock'] = 0;
}
$product->setStockData($stockData);
$product->save();
I want to update inventory quickly.Can anyone help me
Best Answer
Taken from Sonassi:
If you need to squeeze more out there are also other options to consider:
Ideally you'll want to disable auto update indexing during imports and re-enable afterwards as this will kick off other queries during the import.