Created
August 10, 2012 21:30
-
-
Save Zifius/3318209 to your computer and use it in GitHub Desktop.
Magento visibility being reset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If you have hidden products never do collection | |
// saving, without adding visibility attribute to select | |
$products = Mage::getModel('catalog/product') | |
->getCollection() | |
// Important or visibility will be reset to default value (Visible in Catalog and Search) | |
->addAttributeToSelect(array('visibility', 'name')); | |
foreach ($products as $product) { | |
$product->setSomething('someValue'); | |
} | |
$products->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment