I'm trying to update the descriptions of existing products. But I only want to update the description for specific StoreViews without altering the default values.
My code so far:
<?php
$product = Mage::getModel('catalog/product')->load(42);
$product
->setStore(3) //StoreView #3 is specific for english language
->setData(array(
'name' => 'English name',
'short_description' => 'English short desc',
'description' => 'English desc'
))
->save();
?>
After running, the descriptions and name of the product's default values have changed. When I open the product in backend and select my english StoreView, the description fields have the "Use Default" checkbox checked.
What am I missing here?
You have to set the store id before loading the product. In your case you have set the attribute "store" on the product to the value 3. Try:
$product = Mage::getModel('catalog/product')->setStoreId(3)->load(42);
$product->setData(
...