I am trying to bulk update some of my product attributes. Effectively I am using this code:
foreach ($outOfStock as $product) {
$product->setData('attribute',20);
$product->save();
}
However I am getting a php 60 second timeout, when I check, it only got as far as about 15 products. It seems to me that this is not the most efficient way to achieve this.
What is the correct way to update products in bulk?