Reputation: 457
I need to set a couple hundred products attributes to 'use default' value within a certain store view. How can I do this?
Also, due to the reason that I have more than two storeviews, the method of setting general attributes to 'global' and then back to 'normal' is inefficient.
Upvotes: 3
Views: 1627
Reputation: 27305
I think this Link should help you: http://www.magentocommerce.com/boards/viewthread/55480/
In the second comment you can see how to set the store ID for your catalog.
$products = Mage::getModel('catalog/product')->setStoreId(2)
->getCollection()
->addAttributeToSelect('price');
foreach($products as $p) {
// ...
$p->setPrice($price);
$p->save();
}
Upvotes: 4