tags:

views:

26

answers:

0

In Magento I write a number of small command line scripts to do things like set a new attribute on a number of products. I am finding that the time it takes to update 900 products takes about 6 hours to complete.

The time it takes to load the individual products goes as fast as I would except, but the act of saving once I have made the change takes a very long time.

I am attaching how I am loading the products in case there is something I can do to better optimize the process. Any help here would be greatly appreciated.

$product = Mage::getModel('catalog/product')->load($magento_id);
$product->setMadeInUsa(1);
try {
    $product->save();
} catch(Exception $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}

The code runs without error, but it takes forever.

Thanks much

Josh Pennington