I want to update the entire price of a product by a certain percentage of the current price. I got the following line of code update price by wise percentage
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('price');
foreach ($products as $product) {
$product->setPrice($product->getPrice() * 1.03);
$product->save();
echo $product->getId()."updated Sucess";
}
It works well. But it will take so long to complete this process , because we have many products in our store. Sometimes it returns a timeout error . Therefore, I want to perform this operation described above by separating these product families , for example, if we have 1000 products , perform this operation as shown below
Collect 1st 100 products from product collections
Update price of those products
Then collect next 100 products
Update price of those products
Does anyone have an idea to get product collections with some identifiers?