I have a multi-store setup – StoreA, StoreB and StoreC. And within a controller (using the StoreA url) I’m editing a product as follows:
$_product = new Mage_Catalog_Model_Product();
$_product->load($productId);
$_product->setData('attribute1','somevalue');
$_product->save();
If I then go to the Admin / Edit Product for that particular product, I find that attribute1 has been correctly set BUT I also find that if I select StoreA in the “Choose Shop View” I find that all the “Use Default Value” check-boxes (for StoreA) have been set to false.
Questions:
- How do I modify the code above so the “Use Default Value”
check-boxes for StoreA remain true - Once that the above code has been executed (and the “Use Default
Value” for StoreA set to false), how do I revert the “Use Default
Value” values back to true for StoreA?
Edit:
Added screenshot: 
I’m not entirely clear on the ‘Use Default Value’ check-boxes you are seeing, but there are two things I noticed.
Using The Factory Pattern
Your code:
Use the factory pattern, which is standard in Magento:
That in itself isn’t the problem, but it’s something to keep in mind.
Updating Only The Product Attribute
Next, if you are only saving a specific attribute it would be quicker (and potentially avoid your problem) if you update only that attribute. Like so:
Reference for the updateAttributes() method. My reasoning here is that it’s possible default values are being added by saving the entire product, and not just a specific attribute.
If that doesn’t help, perhaps a screenshot of what you are seeing could better help me visualize the issue.